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.
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?