View Full Version : NZ function problem


Maloo
03-20-2001, 12:38 PM
Here is the background -- I have a form that has a calculated field called Total%complete which is calculating from two hidden fields on the form (one field for Total Percent and one field for Total Count). The formula in the Total%Complete field (the control value) is =[Total Percent]/[Total Count].

Here is the problem -- When there are no values in the individual percent complete fields, #Num appears in the Total%Complete field. I know that I need to use the Nz function, but can't get the syntax straight. I have tried numerous ways using the examples in Help, but nothing works.

Would someone out there please write tell me where I should put the Nz function and what the syntax is using the fields I listed above?

Pat Hartman
03-20-2001, 06:29 PM
The Nz() function may not solve your problem here. You need to prevent the division operation from happening when the divisor is zero or null. Try this:

=IIf(Nz([Total Count],0) = 0,0,[Total Percent]/[Total Count])

Maloo
03-21-2001, 04:47 AM
Thank you so much. It worked perfectly.