Solved

Microsoft Access Query Not working

Posted on 2014-01-24
3
1,071 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
3 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
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

Expert Comment

by:Jacques Bourgeois (James Burger)
Comment Utility
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
Comment Utility
Compact and Repair of the back-end did the trick. How weird is that? Thanks a bunch!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

744 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now