Exclude data in qry

  • Thread starter Thread starter Heather
  • Start date Start date
H

Heather

Hello,

I have all this data that I want to exclude from a field
in my qry can anyone tell me how to do it? I tried this
it does not work.

I put the following in the criteria field,

<>"Conference" Or <>"E-Blast" Or <>"Phone Call" Or
<>"Phone Call - In" Or <>"Phone Call - Inbound" Or
<>"Phone Call - Left Message" Or <>"Phone Call - Outbound"
Or <>"Phone Call - Le" Or <>"Phone Call - Ou" Or <>"Office
Day
 
You need to change all the OR's to AND's. Right now, you are saying if the
value is "Conference" exclude the record. So if the value is "Conference" the
first comparison applies and returns False; BUT then the value is checked
against "E-Blast" and the value (conference) is not equal to "E-Blast" so that
comparison returns TRUE. If you use an OR conjunction, you need only ONE true
to return the record

<>"Conference" AND <>"E-Blast" AND <>"Phone Call" AND
<>"Phone Call - In" AND <>"Phone Call - Inbound" AND
<>"Phone Call - Left Message" AND <>"Phone Call - Outbound"
AND <>"Phone Call - Le" AND <>"Phone Call - Ou"
AND <>"Office Day"


OR use the simpler construction of

NOT IN ("Conference","E-Blast","Phone Call", ...)
 
Hello,

I have all this data that I want to exclude from a field
in my qry can anyone tell me how to do it? I tried this
it does not work
I put the following in the criteria field,

<>"Conference" Or <>"E-Blast" Or <>"Phone Call" Or
<>"Phone Call - In" Or <>"Phone Call - Inbound" Or
<>"Phone Call - Left Message" Or <>"Phone Call - Outbound"
Or <>"Phone Call - Le" Or <>"Phone Call - Ou" Or <>"Office
Day

Try NOT IN("Conference", "E-Blast", "Phone Call","Phone Call - In",
....

Your OR clause should have been an AND clause; if the field contains
"Conference" then you can be sure that it does not contain "E-Blast" -
so the criterion will always be TRUE. Even at that, you would have
needed to rename the field for each criterion. The NOT IN() is
simpler!
 
Back
Top