Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formulas for zero

Status
Not open for further replies.

scwk

Programmer
Mar 4, 2003
11
MU
hi


need help, i'm new to crystal reports
Can i know what formula to use to put zero on a field?

I done a query in Access and connect this to CReports
and then i'm doing a total but this don't give me the good result, some did when all the fields contains values, but those who do not contain any value, the sum can't be calculated.

what must i do?
many thanks
scwk
 
I'm not an expert but if I understand your problem correctly, there are two options. One is to turn on "Convert NULL Field Value to Default." This can be found in your options, reporting tab.

The other option is to create a formula and total on that. The formula might look like:
Code:
if ISNULL{mytable.numberfield} then
     0
else
     {mytable.numberfield}

Some of the experts here can probably do a better job of explaining this. James P. Cottingham

When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.
 
thanks James But when using the formula, there is a syntax error message, the keyword 'then' is missing
can you reply me please?
its very urgent i d'ont found any solution

thanks
scwk
 
hi
here try this

if ISNULL({mytable.numberfield}) then
0
else
{mytable.numberfield}


pg

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top