Link to home
Start Free TrialLog in
Avatar of mbroad02
mbroad02Flag for United States of America

asked on

Crystal Reports-How to display nulls as zero

Here's another one for the Crystal gurus.  I am not really familiar with using formulas on the "Format field" page.  I have the following issue:

I am performing a summary on a detail record amount field , displaying the summary field on the report.  For some reason, if there are no detail records or the amount fields are null, the summary shows up on the report as blanks (or null?).   I have the selector set to "show zero value as 0."  However, i don't know how to get it to show a blank or null value as zero (which is a requirement.
help!  thanks
Avatar of by6738
by6738

You can display null values as zero by implementing the following formula:

if (isnull({yourNumberField})) then
0
else
{youNumberField}
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mbroad02

ASKER

I appreciate your suggestions.  However when I use the formula:

Global currencyVar AMT_TOT;if (isnull(AMT_TOT)) then0elseAMT_TOT;

I get an error saying "A field is required here" for the AMT_TOT right after the isnull.

What am I doing wrong?
A variable cannot be NULL, you can only test database fields with IsNull.

mlmcc
go to report options in the file menu and check the 'set database values to default'