Skip to Content
0

Crystal Report SUM Case when

Feb 16, 2017 at 03:04 AM

88

avatar image

Good Day Expert,

How can I apply this code in Crystal report? Bec im always got an error "DateDiff is out of range"

ISNULL(SUM(CASE when (DATEDIFF(dd,JDT1.RefDate,@Date) <=0)
then
case when syscred <> 0 then syscred * - 1
else sysdeb
end
end),0.00)

or

SELECT datediff("dd",{JDT1.RefDate},{?FromDate})
Case is >0: Sum({JDT1.BalDueDeb})-sum({JDT1.BalDueCred})
Default: 0

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Abhilash Kumar
Feb 16, 2017 at 08:44 AM
0

Hi Romel,

"dd" is not a valid interval type; it is "d".

If datediff("d",{JDT1.RefDate},{?FromDate}) > 0 then

Sum({JDT1.BalDueDeb})-sum({JDT1.BalDueCred})

else 0

-Abhilash

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thank you so much sir.

Can you help me to my report. I want to display sum of previous balance when my parameter is JDT1RefDate>=FromDate and JDT1.RefDate<=ToDate. I want to display the Sum(BalDuedeb-BaldueCred) when JDT1.RefDate<FromDate

Thanks

0