Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8705

Crystal Reports Calculation Error

$
0
0

Hi All,

 

I have some issues with the following syntax:

if month({InvCredHead.DocDate}) = month({?DATE})

and year({InvCredHead.DocDate}) = year({?DATE})

//and {InvCredHead.SOURCE} = "CRED"

and {InvCredHead.ObjType} = "14"

and {InvCredHead.DocTotal} <> 0

then ({InvCredHead.DocTotal} - {InvCredHead.vatsum} - {InvCredHead.DiscSum}) * (-1)

 

ELSE

IF month({InvCredHead.DocDate}) = month({?DATE})

and year({InvCredHead.DocDate}) = year({?DATE})

//and {InvCredHead.SOURCE} = "INV"

and {InvCredHead.ObjType} = "13"

and {InvCredHead.DocTotal} <> 0

then ({InvCredHead.DocTotal} - {InvCredHead.vatsum} - {InvCredHead.DiscSum})

 

The INVCREDHEAD is a view that unions invoice and credit note headers.

If i exclude the  "*(-1)" from then ({InvCredHead.DocTotal} - {InvCredHead.vatsum} - {InvCredHead.DiscSum}) * (-1), the result returned is correct, only positive.

If i include the "*(-1), the result returned is zero

 

How can i get this to return the correct negative value?

 

Thanks in advance,

 

Regards,

Kiran


Viewing all articles
Browse latest Browse all 8705

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>