IIf(IsError... in a query

  • Thread starter Thread starter beppe005
  • Start date Start date
B

beppe005

I am trying to use the two functions IIf and IsError in a query in this way,
which is wrong (since it doesn't work):

Total: IIf(IsError([field1]/[field2];0;[field]/[field2])

my intenttion is that, if the result of the division is "error", for example
because [field2]=0, then value of [Total] is "0", otherwise the result of
the division should be the true result of the division.

TIA
Beppe
 
beppe005, Try something like this:

Total: IIf(Nz([Field2],0)=0,0,(Nz([Field1],0))/[Field2])
 
Back
Top