Solved

Microsoft Access Query Not working

Posted on 2014-01-24
3
1,644 Views
Last Modified: 2014-01-24
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
Comment
Question by:Ei0914
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 39807820
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
 
LVL 40
ID: 39807856
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
 

Author Closing Comment

by:Ei0914
ID: 39807921
Compact and Repair of the back-end did the trick. How weird is that? Thanks a bunch!
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question