Link to home
Create AccountLog in
Avatar of asnath
asnath

asked on

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!

~nat
SOLUTION
Avatar of bdreed35
bdreed35
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
ASKER CERTIFIED SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of asnath
asnath

ASKER

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"
Avatar of asnath

ASKER

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)
Avatar of asnath

ASKER

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

What could be wrong with this?
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of asnath

ASKER

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

~nat