Solved

Crystal Reports 8.5 Division By Zero Error Message

Posted on 2007-04-11
3
2,104 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
Comment Utility
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
Comment Utility
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
Comment Utility
Glad i could help

mlmcc
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now