Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2007

Tip: Looking for answers? Try searching our database.

Multiple AND criteria

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Laury - 13 Nov 2007 19:51 GMT
I'm trying to run a query that pulls in records without certain states
(approx. 20 of them) anywhere in a field's text.  I set up the criteria as

<>"*Maine*"and<>"*New Hampshire*"and<>"*Rhode Island*"

This is still returning records with the states in them - for example "EC
MaineCalc".
Anyone know what I'm doing wrong?
fredg - 13 Nov 2007 20:12 GMT
> I'm trying to run a query that pulls in records without certain states
> (approx. 20 of them) anywhere in a field's text.  I set up the criteria as
[quoted text clipped - 4 lines]
> MaineCalc".
> Anyone know what I'm doing wrong?

When you use the wildcard * you must also use the Like keyword.
Like "*Maine*"
since you do not want Maine, then it's Not Like:

Not Like "*Maine* and Not Like "*New Hampshire* and Not Like etc....

You'll need to be careful with a state such as Virginia, as Virginia
is included within "West Virginia".
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Jason Lepack - 13 Nov 2007 20:14 GMT
Unless you use LIKE then it intereprets "*STRING*" as literally
"*STRING*"

> I'm trying to run a query that pulls in records without certain states
> (approx. 20 of them) anywhere in a field's text.  I set up the criteria as
[quoted text clipped - 4 lines]
> MaineCalc".
> Anyone know what I'm doing wrong?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.