How do I default the null field to zero?

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!

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Under the File menu, Report Options.
You have 2 options to Convert Nulls there, Database values and/or Other values.
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
asnathAuthor Commented:
If I want to convert the null values to zero do i do there in the report options.?

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

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"
asnathAuthor Commented:
But I am doing summary of many of these fields this change in the Report options will not work for the real calculations that correct?

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

In this calculation any one of the field maybe null 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)
asnathAuthor Commented:
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.
asnathAuthor Commented:
bdreed35 and wykabryan ....
Thank you very much for you help!

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

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.