NOT IN question

  • Thread starter Thread starter Guy Dillen
  • Start date Start date
G

Guy Dillen

I have a table person with e.g. the following columns:
name, firstName, status

the status field is a 1 char textfield.

now when i launch the query:

select * from person where status NOT IN ('A', 'B, 'C')

the query EXCLUDES the records/rows that have A, B or C in their status
column BUT also de records/rows that have a blank ' ' in their status
column!

Anyone has an idea why this happens?

Thanks,

Guy
 
Thanks John.


John Spencer (MVP) said:
Because the Status field does not contain an empty string, but contains NULL
which never matches anything.

Try
SELECT *
FROM Person
WHERE Status Is Not Null OR Status Not In ('A','B, 'C')
 
Back
Top