Queries using the <> command

  • Thread starter Thread starter dallin
  • Start date Start date
D

dallin

I've been unsuccessful on using this command for
multilple not conditions. such as <> "Ted" and
<> "Jane"? Please provide the correct syntax that allows
multiple not situations in a query. Thanks.
 
WHERE MyField <> "Ted" AND MyField <> "Jane"

or

WHERE MyField NOT IN ("Ted", "Jane")
 
I just tried both methods, however, I still was
unsuccessful on excluding the second item. I went out in
SQL to view the code, it appears as noted below. So in
the below example it only excludes Ted not Jane? Please
provide suggestions. Thanks.
 
I just tried both methods, however, I still was
unsuccessful on excluding the second item. I went out in
SQL to view the code, it appears as noted below. So in
the below example it only excludes Ted not Jane? Please
provide suggestions. Thanks.

That's peculiar. Please open the query in SQL view and post the entire
SQL string here. I suspect there are other criteria interfering!
 
WHERE ((([2003DSL].WELL)<>"406001" And ([2003DSL].WELL)
<>"417401"))
This is the statement in sql view that only excludes
406001 not 417401. Why is it only excluding the first
one an not the second one. Thanks.
 
WHERE ((([2003DSL].WELL)<>"406001" And ([2003DSL].WELL)
<>"417401"))
This is the statement in sql view that only excludes
406001 not 417401. Why is it only excluding the first
one an not the second one. Thanks.

Are you quite certain that the record you think is not being excluded
actually has the value "417401"?

Is it possible that there are leading spaces or that you have a lower case
"L" in there instead of the digit "1" or even the letter "O" instead of a
zero?
 
You were right - a wrong digit!! It is working!! Thanks
so much for your help and patience.

-----Original Message-----
WHERE ((([2003DSL].WELL)<>"406001" And ([2003DSL].WELL)
<>"417401"))
This is the statement in sql view that only excludes
406001 not 417401. Why is it only excluding the first
one an not the second one. Thanks.

Are you quite certain that the record you think is not being excluded
actually has the value "417401"?

Is it possible that there are leading spaces or that you have a lower case
"L" in there instead of the digit "1" or even the letter "O" instead of a
zero?


--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


.
 
Back
Top