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

x
?
Solved

Divide by zero error

Posted on 2014-01-13
2
Medium Priority
?
418 Views
Last Modified: 2014-01-13
I have a formula that on certain items will cause a divide by zero error.  I need to figure out how to get past this and not calculate the formula if there is a zero.

({XFGMULTI.NEW_QUAN} / {@perpetual}) * 100
0
Comment
Question by:Kim Williamson
[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 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 39777938
You need to test for the 0 divisor before dividing

Try this
If  {@perpetual} = 0 then
    0
Else
    ({XFGMULTI.NEW_QUAN} / {@perpetual}) * 100 

Open in new window


You can have it return any value if it is 0

If you want it to be blank then

If  {@perpetual} <> 0 then
     ({XFGMULTI.NEW_QUAN} / {@perpetual}) * 100 

Open in new window


mlmcc
0
 

Author Closing Comment

by:Kim Williamson
ID: 39778118
The first example was exactly what I needed.  Thanks!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

670 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