I'm using Windows Access 2010. I'm trying to run an IIF Function, using Expression Builder, in a query on one table that asks the query to add three fields together and compare the answer to a fourth field. If the sum of the three fields are equal to the fourth field return "Ok" if not equal return"Err".
This is the the expression I'm using:
SalmonRelSum: IIf([SalmonRelUM]+[SalmonRelAd]+
[SalmonRelUK]=SalmonReleasedCount],"Ok","Err")
When I run the query I get Err on all lines whether it is correct or not.
What am I doing wrong?
Assuming that you really mean this:
The problem is probably
NULL
values. You can use theNZ()
function to treat them as zeroes: