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
Solved

Not Like IN Access Query not Working

Posted on 2016-10-11
10
335 Views
1 Endorsement
Last Modified: 2016-10-11
hello,

I have a query that I need to filter on one field:

I have used every combination I can think of to get it to work.

(Not Like "*HWW*")
Not Like "HWW"
<>"HWW"


I have about 16,000 records and I can't get this to sort it out.

Like "HWW" works fine, but not using  NOT LIKE

?
1
Comment
Question by:Ernest Grogg
10 Comments
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 41839142
Well,

Like "HWW"

is the same as:

= "HWW"

Like "*HWW*"

will return all records that contain the string "HWW" anywhere within the field

So, what is it you really want to do?  Write it out in text, don't worry about SQL format
0
 
LVL 7

Expert Comment

by:Anders Ebro (Microsoft MVP)
ID: 41839146
I am a bit confused. Like is an operator to be used with partial matches. If you omit the * there are no partial matches and you are looking for exact matches (or the opposite of exact matches as it may be)

Like is the expression you want to have evaluated, so I imagine it should look like
For exact non matches
<>"HWW"
For not "contains"
Not (Like "*HWW*")
0
 
LVL 15

Expert Comment

by:John Tsioumpris
ID: 41839147
Maybe your query has OR somewhere that "disables" your NOT Like "*HWW*"
Just take your data and use only the NOT Like Criteria...nothing Else...
0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 

Author Comment

by:Ernest Grogg
ID: 41839160
I am trying to get

All records without the Word:  HWW for a particular field

No other criteria is in the query

searching/Filtering for "HWW" on that field works fine

but not when I don't want "HWW" to be included in the query
0
 
LVL 75
ID: 41839169
How about

Not IN ("HWW")
0
 

Author Comment

by:Ernest Grogg
ID: 41839180
Nothing on the

Not IN ("HWW")


I removed all except about 5 with the

HWW

and it should return all the records except those 5  but I get nothing returned
0
 
LVL 15

Expert Comment

by:John Tsioumpris
ID: 41839181
how about using a smaller subset of your data...just make a copy of your data and keep only lets say 100 records...
0
 

Author Comment

by:Ernest Grogg
ID: 41839186
Created a new table and ran a query on that..nothing..

Is 72 records.
Database5.accdb
0
 
LVL 15

Accepted Solution

by:
John Tsioumpris earned 500 total points
ID: 41839201
its the null that causes the problem
Not Like "*hww*" Or Is Null

Open in new window

0
 

Author Comment

by:Ernest Grogg
ID: 41839210
Wow....Thanks so much John!
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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…

792 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