How To Compare Fields With Null Values In Access
I have a query that looks at one tables field and matches the second table's field. It looks to see if the fields don't match each other. If there's no match the second table's fie
Solution 1:
You are experiencing the fact that null <> null.
You can work around this with IsNull(), if you are able to define a string value that never appears in both columns:
IsNull([NAVAIR Deficiencies]![Hull Q], '§§§§')
<> IsNull([NAVAIR_Deficiencies_Temp]![Hull Q], '§§§§')
This treats two null value as equals, and considers that a null value is not equal to any non-null value.
Or, you can enumerate all possible situations, using boolean logic
[NAVAIR Deficiencies]![Hull Q]) <> [NAVAIR_Deficiencies_Temp]![Hull Q]
or ([NAVAIR Deficiencies]![Hull Q] is null and [NAVAIR_Deficiencies_Temp]![Hull Q] is not null)
or ([NAVAIR Deficiencies]![Hull Q] is not null and [NAVAIR_Deficiencies_Temp]![Hull Q] is null)
It might be simpler expressed with a negation:
not (
[NAVAIR Deficiencies]![Hull Q]) = [NAVAIR_Deficiencies_Temp]![Hull Q]
or ([NAVAIR Deficiencies]![Hull Q] isnulland [NAVAIR_Deficiencies_Temp]![Hull Q] isnull)
)
Post a Comment for "How To Compare Fields With Null Values In Access"