Decimal divide in report calculation

Steve_Bache

Registered User.
Local time
Today, 23:06
Joined
Mar 13, 2006
Messages
24
Help please , I have a calculated field in a report that works fine (most of the time) :-

=(100/(Sum([Sum Of Count])-Sum([Expr1])))*Sum([Completed])

but I get a decimal divide (obviously) if dividing 100 by zero. What is the correct syntax for testing and bypassing this ?

Suggestions ( helpful ones !) welcome.

Cheers

Steve
 
Unless you can test a single expression, the following should work

Code:
= if((Sum([Sum Of Count])-Sum([Expr1])))*Sum([Completed]) = 0, 0, 100/(Sum([Sum Of Count])-Sum([Expr1])))*Sum([Completed]))

This was just off the top of my head, there may be a better way to do this...
 
Ken ,

Thanks for the response - will give it a try !

Cheers

Steve
 

Users who are viewing this thread

Back
Top Bottom