Solved

Microsoft Access Query Not working

Posted on 2014-01-24
3
1,437 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…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

749 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