Division by Zero

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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
 
Back
Top