Division by Zero

G

Guest

I have a query that is using an expression to calculate price and it
generates a "#Error" entry when it encounters a record which has a zero as
entries for the expression:

Exp_Price_byArea: Nz(([x_Q_PM_sum_Val_Calc_01]![SumOfExpr1]);0) /
Nz(([x_Q_PM_sum_Val_Calc_01]![SumOfQ_2006]);1)

I tried to use Nz function to force a 1 in the denomenator but it does not
work can some one help with the above problem, thanks.
 
M

Michel Walsh

Hi,



Note that a NULL value is not a ZERO, it is a value that is not
supplied. Your NZ catch the NULL, not the ZERO.


numerator / iif( denum = 0, 1, denum)


is preferable to divide without getting division by zero.



Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Division by Zero Error 1
Access #Error & Excel Pivot 0
division by Zero and expression to complex 2
Division by zero 4
Nz or Iif 8
QRY FORMULA ISSUE 4
Query Criteria Not Working 2
NZ function 1

Top