Overflow Error being caused by #NUM

dbaker5204

Registered User.
Local time
Today, 01:40
Joined
Jan 19, 2018
Messages
20
I am getting an overflow error when I try to perform a calculation in a query. There is dividing by zeros, so I do have #NUM errors in this field. Can I write an IIF statement to ignore the #NUM?

Right now my IIF statement reads as:

IIf([Quality Success Ratio]>=0.8,"1","0")
 
You should write an IIf statement to avoid #NUM

If the divisor is going to be 0 in that calculation, don't do the calculation, instead substitute a different value.
 
The words in your problem statement don't QUITE match up to the code you offered because there IS no division in that statement.

The solution to your problem will always depend on what you want to see in the two cases, and you CAN write an IIF to fix it. I'm going to make up some names.

Code:
IIF( [Factor]<>0, [Observation]/[Factor], 0 )

That is, where you would have a division by zero, test the divisor first before you even attempt the operation. That should get rid of the #NUM errors.
 

Users who are viewing this thread

Back
Top Bottom