Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2417
  • 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)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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

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