Solved

Crystal Reports 8.5 Division By Zero Error Message

Posted on 2007-04-11
3
2,109 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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to set IPSec under Server 2008 R2 and Server 2012 R2 3 42
Problem to Alipay 10 42
URGENT: Re-install Windows 10 using same license? 18 74
Fatal Error 11 40
This is an article about Leadership and accepting and adapting to new challenges. It focuses mostly on upgrading to Windows 10.
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

809 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