Solved

Crystal Reports 8.5 Division By Zero Error Message

Posted on 2007-04-11
3
2,108 Views
Last Modified: 2009-12-16
I currently running Crystal Reports 8.5
I am getting a Division By Zero error on the following code.

({INVENTOR.PRICE_CODE_1} - {INVENTOR.UNIT_COST}) / {INVENTOR.UNIT_COST} * 100

The code above is being used as a formula field {@Percent}
What gives?
0
Comment
Question by:CarloVasquez
  • 2
3 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 125 total points
ID: 18890211
Apparently you have a product with unit-cost of 0

Try this
if {INVENTOR.UNIT_COST} = 0 then
   0
else
   ({INVENTOR.PRICE_CODE_1} - {INVENTOR.UNIT_COST}) / {INVENTOR.UNIT_COST} * 100

mlmcc
0
 
LVL 42

Assisted Solution

by:frodoman
frodoman earned 125 total points
ID: 18890215
If unit cost is zero you'll get this error.  Change your formula to this:

if {INVENTOR.UNIT_COST} = 0 then
   0
else
   ({INVENTOR.PRICE_CODE_1} - {INVENTOR.UNIT_COST}) / {INVENTOR.UNIT_COST} * 100;

That should handle the problem.

frodoman
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18890753
Glad i could help

mlmcc
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an article about Leadership and accepting and adapting to new challenges. It focuses mostly on upgrading to Windows 10.
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question