I have a query and in one field I am looking for all of the codes, except 6.
There are too many codes to say I only want to see these...In the criteria I
have entered it as <>AB, or <>CD, etc. I have also tried going down the rows
for "or" but none of this has worked. It will only work with one code.
Does anyone have any suggestions or can you tell me why this isn't working?
Thanks!
KARL DEWEY - 15 Jun 2007 17:25 GMT
Not OR but AND.
On the same criteria row enter ---
<>AB And <>CD And <>DS

Signature
KARL DEWEY
Build a little - Test a little
> I have a query and in one field I am looking for all of the codes, except 6.
> There are too many codes to say I only want to see these...In the criteria I
[quoted text clipped - 4 lines]
>
> Thanks!
TJAC - 15 Jun 2007 18:11 GMT
That didn't work either...
> Not OR but AND.
> On the same criteria row enter ---
[quoted text clipped - 8 lines]
> >
> > Thanks!
Ken Sheridan - 15 Jun 2007 18:24 GMT
You need to repeat the column name for each Boolean AND operation. In SQL it
would be:
WHERE YourColumn <> "AB"
AND YourColumn <> "CD"
AND YourColumn <> "DS"
In query design view you'd add the column to the grid once for each value
you need to exclude, uncheck the 'show' check box for all but the first and
in the criteria row of the first put the <> "AB", in that of the second <>
"CD" and so on.
Using a NOT IN operation with a value list as Kerry suggests is simpler,
however.
Ken Sheridan
Stafford, England
> That didn't work either...
>
[quoted text clipped - 10 lines]
> > >
> > > Thanks!
Kerry - 15 Jun 2007 17:26 GMT
Hi
It is working, it just isn't doing what you expected. If a code is AB
it is true that it is <>AB or <>CD, because it is not CD. I think you
are looking for <>AB AND <>CD, etc. You could also use in, for
example not in ("AB","CD","ETC")
> I have a query and in one field I am looking for all of the codes, except 6.
> There are too many codes to say I only want to see these...In the criteria I
[quoted text clipped - 4 lines]
>
> Thanks!