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 / New Users / August 2005

Tip: Looking for answers? Try searching our database.

Problem with Query NOT IN statements

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
James K - 31 Aug 2005 17:37 GMT
I want to Query a Table using the Query builder.  I want to find certain
words and exclude them from the results.

I was told by a friend to use the following syntax.     NOT IN ("CO","CORP",
"Corporation")

When I do this, those items with CO, Corp, and Coporation are still in the
results. What have I missed.
Steve Schapel - 31 Aug 2005 19:54 GMT
James,

The syntax you have used is applicable if the values you are trying to
exclude are the entire entry in the field.  Is that the case?  And you
have put this in the Criteria of the field in question?  Or do you mean
to exclude entries where CO, CORP, etc are included in the text in the
field?  If that's the case, you may need something like this...
 Not Like "*CO *" And Not Like "*CORP *"

Signature

Steve Schapel, Microsoft Access MVP

> I want to Query a Table using the Query builder.  I want to find certain
> words and exclude them from the results.
[quoted text clipped - 4 lines]
> When I do this, those items with CO, Corp, and Coporation are still in the
> results. What have I missed.
James K - 31 Aug 2005 20:21 GMT
It's the latter.  But when I do that, I exceed the 2048 limit of SQL and 1024
of the Expression Builder.  How do I get arouund this limit?  

>James,
>
[quoted text clipped - 10 lines]
>> When I do this, those items with CO, Corp, and Coporation are still in the
>> results. What have I missed.
Steve Schapel - 31 Aug 2005 21:19 GMT
James,

Just a wild stab in the dark here.  But I guess this can happen if...
- the name of the table(s) and/or fields are very long, and/or
- you have a large number of fields included in the query, and/or
- you have some calculated fields on the query, with long expressions,
and/or
- your want to exclude data according to a larger number of criteria
than you have let on so far.

Am I getting warm on any of these?

Signature

Steve Schapel, Microsoft Access MVP

> It's the latter.  But when I do that, I exceed the 2048 limit of SQL and 1024
> of the Expression Builder.  How do I get arouund this limit?  
 
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.