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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

divide by zero

Status
Not open for further replies.

zippyhm

Programmer
Jan 8, 2003
7
GB
Hi guys
Has anyone ever had a crystal report problem with divide by zero. I have a clause in the formula which checks for it but still the report turns up a divide by zero error.
Its basically
if not zero
do stuff
else
0
Is this a known problem???

cheers
zippy
 
Paste in the formula if the following doesn't resolve.

Divide by zero errors are common, but I've not experienced a bug that causes them, rather an oversight in my code.

If you're going to do division, always do something like:

If not(isnull({MyTable.Factor})) <> 0
and {MyTable.Factor} <> 0
then
{MyTable.Amount}/{MyTable.MyField}
else
0

The not(isnull()) may be overkill.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top