Ramco Ramco

Ramco Ramco

  • 438
  • 3.4k
  • 542.3k

Color Particulars column if value is -ve

Aug 16 2023 12:25 AM

Hi

 I have below code . I want if Closing Balance is -ve then its value should be Red. Can it be done thru HTML in stored procedure

(SELECT 'A/C Bal.' 'Type',cast(getdate() as date) [Posting Date],'' [Document No],'' [Voucher No.],'' Line_ID,'ABC Bank Ltd' + ' ' +'('+' '+'Closing Bal.'+' '+'='+' '+cast(cast(ISNULL(SUM(S.Debit)-SUM(s.Credit),0.00) +(select sum(debit)-sum(Credit) from jdt1 where jdt1.refdate<cast(DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0) as date) ) as numeric(19,2)) as nvarchar(max))+')' 'Particulars',null [Debit(LC)]

,null[Credit(LC)],null [Debit(FC)]

,null[Credit(FC)]

FROM JDT1 S left join oact d on d.AcctCode=s.ShortName

WHERE S.RefDate=cast(DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0) as date) )

Thanks


Answers (2)