Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1987
  • Last Modified:

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?
0
Eileen Murphy
Asked:
Eileen Murphy
1 Solution
 
Rey Obrero (Capricorn1)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)Commented:
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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now