Microsoft Access Query Not working

I have a customer table with a text field called "Country"

When I run a query with the criteria of Country = "Canada" I get the correct results.

When I run the query with the criteria of Country <> "Canada" I don't get any records.

I have never seen this before. I initially had tried to do this in VBA but when that didn't work I created a query and it's still not working.

Weird. Any ideas?
Eileen MurphyIndependent Application DeveloperAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
have you tried doing a Compact and Repair ?

what if you use another country name, are getting results?


try using this as the criteria


not in("Canada")
0
 
Jacques Bourgeois (James Burger)PresidentCommented:
If the country that are not in Canada are Null, they won't be found. By default, Null values are disregarded by queries because they are indeterminate. That is one reason that many database designers will prefer a default value (something as "(unknown)" instead of a Null to represent unknow data.

If this is the case, then the following should work:

<> "Canada" Or Is Null
0
 
Eileen MurphyIndependent Application DeveloperAuthor Commented:
Compact and Repair of the back-end did the trick. How weird is that? Thanks a bunch!
0
All Courses

From novice to tech pro — start learning today.