Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dividing by zero

Status
Not open for further replies.

jschill2628

Programmer
Nov 3, 2009
156
US
I have a formula:

if isnull ({@Serious Event Count}) or ({@Serious Event Count}) = 0 then "0" else
totext(sum({@near miss count})/sum({@Serious Event Count}),0,"")

and when I run the report, it seems to be pulling only zero. For example if I have 9 serious safety events, and 27 near miss events, then my ratios should be 1 and 3 respectively, but I am getting 1 and 0. It works if I comment out the first line, but then if I have a situation where I am dividing by zero, then i get an error, so what should I do, I feel like I should rearrange the formula some how, but I am not getting it. I have played with this for hours, and I am getting the same thing. can some one please help. I need the formula to give me the number, and if the number is being divided by zero, then give me a zero.

Thanks in advance!!!
 
If possible try to modify this formula {@Serious Event Count} so that it can not return a null, Ideally it should return a value or zero.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top