Errors if zero

SteveF

Registered User.
Local time
Today, 04:38
Joined
Jul 13, 2008
Messages
218
I've tried, really I have, but I can't find the answer so please excuse if the question has been asked and answered a gazillion times already.

I'm running a query that reports a profit margin on consumption with the answer expressed as a percentage:

GP %: ([GP Amount]/[Cons Ex VAT])

The trouble is that on many occasions both parts of this equation will be zero, and are displaying zeros quite happily in all the other places they are seen, but my query reports an error ( presumably because it is trying to divide zero by zero).

I've tried the Nz function but can't seem to get that to work, so my question really is can I either force a '0' instead of an error or, alternatively, can I display nothing at all rather than an error?

All help appreciated.
 
I have no clue what you're doing, but here is a starting point:

Code:
Iif([Cons Ex VAT] <> 0, [GP Amount]/[Cons Ex VAT], 0)
 
Thanks, I will give that a whirl and report back
 

Users who are viewing this thread

Back
Top Bottom