Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Crystal Reports 8.5 Division By Zero Error Message

Posted on 2007-04-11
3
Medium Priority
?
2,117 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 500 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 500 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 101

Expert Comment

by:mlmcc
ID: 18890753
Glad i could help

mlmcc
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Configuring Remote Assistance for use with SCCM
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

705 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