Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Null and Not Null Values in Crystal Reports 2013

Status
Not open for further replies.

kv444

Programmer
Nov 20, 2011
23
US
Hi All,

I am facing issues while adding two numbers in crystal reports formula since one of the numbers is a null value,crystal reports is adding the null value and not null value and giving the output as a null value. Here is an example:

I have 2 variables : Amounts and tax. Here are the 2 scenarios:

I want to do a sum : Amount + Tax if

1. when Amount is NULL
2. When Tax is NULL

I wrote a formula like this:

SUM=
if isNull(Amount)+ Tax
then SUM
Else Amount + isNULL(TAX)


for some reason this is not working right both these scenarios. The first null is getting the first priority. Could you please let me know how to fix this so that it can handle the NULL values and do an addition correctly even if either of these values are null.


Thanks for the help in advance !


Thank you !

 
(if isnull(AMOUNT) then 0 else AMOUNT)
+
(if isnull(TAX) then 0 else TAX)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top