-
January 4th, 2013, 04:43 PM
#1
Rogue "Divide By Zero" error in 8.5
I have a report that is throwing a "Cannot Divide By Zero" error. I cannot for the life of me figure out what is in the data that is causing this. I have modified every formula that I can find to account for 0s as well. Is there an easy way to track down where this error is coming from? I'm fairly new to Crystal Reports...
-
January 4th, 2013, 06:20 PM
#2
Re: Rogue "Divide By Zero" error in 8.5
Welcome to CodeGuru forums!
One way to protect every division is in the next example
Code:
If {TableN.Quantity} <> 0 Then {TableN.Amount} / {TableN.Quantity} Else 0
JG
... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...
-
January 4th, 2013, 08:07 PM
#3
Re: Rogue "Divide By Zero" error in 8.5
Originally Posted by jggtz
Welcome to CodeGuru forums!
One way to protect every division is in the next example
Code:
If {TableN.Quantity} <> 0 Then {TableN.Amount} / {TableN.Quantity} Else 0
I have put that If-Then statement around every place that I can find where I am doing division and I'm still getting it.
-
January 4th, 2013, 11:11 PM
#4
Re: Rogue "Divide By Zero" error in 8.5
In Crystal Reports ide, load the problematic report
click over Export button
>>Select "Report Definition"
>>Select "Disk File"
>>Click OK
It generate a txt file with all the report features... maybe it can help
JG
... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...
-
January 7th, 2013, 08:23 AM
#5
Re: Rogue "Divide By Zero" error in 8.5
Originally Posted by jggtz
In Crystal Reports ide, load the problematic report
click over Export button
>>Select "Report Definition"
>>Select "Disk File"
>>Click OK
It generate a txt file with all the report features... maybe it can help
Thanks! That was a huge help. I just reviewed the file and every one of my formulas that are doing division look like this...
if tonumber({REPORT.LBS_TOTAL}) > 0 then
tonumber({REPORT.GAL}) * tonumber({REPORT.LBS_PER_LOAD}) / tonumber({REPORT.LBS_TOTAL})
else
0
-
January 11th, 2013, 04:47 PM
#6
Re: Rogue "Divide By Zero" error in 8.5
How do I find out what the current database driver is? It looks like I need to change the driver, but I need to know what it currently is so I can change it back.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|