• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1073
  • Last Modified:

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
0
mbroad02
Asked:
mbroad02
1 Solution
 
by6738Commented:
You can display null values as zero by implementing the following formula:

if (isnull({yourNumberField})) then
0
else
{youNumberField}
0
 
mlmccCommented:
If you mean the summary field, I don't think you can.  You can however use the formula above and then summarize that one and get the 0 to display.

mlmcc
0
 
mbroad02Author Commented:
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?
0
 
mlmccCommented:
A variable cannot be NULL, you can only test database fields with IsNull.

mlmcc
0
 
ColB7533Commented:
go to report options in the file menu and check the 'set database values to default'
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now