Query: Not commands

Blackops

Registered User.
Local time
Yesterday, 16:30
Joined
Mar 23, 2011
Messages
14
I'm hoping someone will be able to assist me with a basic question that I do not have the answer for:

I have a query which I'm trying to have populate leaving out data within a single field that has the following listed: MD, RW, XX, MT, AC.

I have tried the following but they all return the first item on the list but do not apply it to the remaining.

Not MD or RW or XX or MT or AC
Not MD and RW and XX and MT and AC

In the cases above I get a return query with MD not included but will include the rest on the list. How can I get it to not include all listed?

Thanks
 
Try using this:

Not MD and Not RW and Not XX and Not MT and Not AC

The reasoning behind this is that in your original query you are effectively asking for something that isn't MD, but it's okay for it to be RW or XX or MT or AC. The code needs to know that you don't want each or any of them.
 
Another option would be;

Not In ("MD","RW","XX","MT","AC")
 
Thank you very much. It worked, much appreicated.
 

Users who are viewing this thread

Back
Top Bottom