We help IT Professionals succeed at work.

Crystal Reports - When field is empty, display a zero

Jasmin01
Jasmin01 asked
on
Hi, I have several formula fields that look similar to this:

if {DailySummary.Activity} = 9 then
SUM({DailySummaryPeople.ContractDriverNormalA})
else 0

Now, when the DailySummary.Activity for the date range entered is not 9, I want there to be a 0 displayed, but I get a blank field instead.  Can anyone help me to get this working?
Comment
Watch Question

Hi,
Please check data Type of {DailySummary.Activity}
if it is int then check is there any null stored



Dani
Commented:
Try this

If IsNull({DailySummary.Activity}) or {DailySummary.Activity} <> 9 then
0
else
SUM({DailySummaryPeople.ContractDriverNormalA})


Author

Commented:
I checked the DB, and it is of type int, and nulls are allowed.  I cannot make chnages to the DB.  Is there anything else I can do?

Author

Commented:
Thanks.  It worked