We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


How do I default the null field to zero?

asnath asked
Medium Priority
Last Modified: 2010-07-22
I have summary calculations involving different fields which are sometimes null values. How do I handle those null values and default them to zero in crystal reports.?

Isnull function does check for the null value but is there any built in function like NVL in crystal to do the same functionality as defaulting the field to zero.

Thanks in advance!

Watch Question

Top Expert 2004
Under the File menu, Report Options.
You have 2 options to Convert Nulls there, Database values and/or Other values.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
There are a few of place that you can do this.
1. Using a view, put a check in on number fields - isnull(column, 0) as columnname
2. In the area the bdreed35 stated
3. Right click on the column in the report, go to format field.  
   Click on Customize, and go to Show Zero Values as

Using any combination of these will ensure that no nulls are displayed.


If I want to convert the null values to zero value....how do i do there in the report options.?

Goto File > Report Option>
In there, it should read something like "Convert database NuLL values to default" and "Convert Other Null Values to Default"

If you want to apply this to all reports:
Goto File>Options> Reporting Tab>
In there, you should see under that Reading Data section, "Convert other NULL Values to Default"


But I am doing summary of many of these fields this change in the Report options will not work for the real calculations ...is that correct?

If I want to add column1+column2 +column3 + column4+ column5 ....................

In this calculation any one of the field maybe null anytime......so how do i handle this null problem in this summary calculation.
By setting the defaults and other options, it should take care of this issue.  If it does, adding the isnull function around every column will convert it all over for you.

isnull(column1,0)+isnull(column2,0) +isnull(column3,0) + isnull(column4,0)+ isnull(column5,0)


If I do isnull(column1,0)
It says
Too many functions have been given to this function.

What could be wrong with this?
local numbervar column1:= if isnull([column1name]) then 0 else [column1name];
local numbervar column2:= if isnull([column2name]) then 0 else [column2name];


Oops, sql server coding coming out.  You actually have to set the values to zero if null.


bdreed35 and wykabryan ....
Thank you very much for you help!

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.