Records with null contents fail query

J

John Gilchrist

I created a query to exclude certain records

I placed a criteria on Field1

not like "*foreign*"

This query excluded all records which contained the text string "foreign" in
Field1, which is what I wanted.

This query also excluded all records for which Field1 was null - I did not
want this results.

My workaround was to require some default content for Field1.

Is there any way to set up a query such that null fields do not "fall out"
of the query??

Thanks,
John
 
D

Douglas J. Steele

The IsNull function you've posted is the SQL Server version, not the Access
one. In Access, IsNull doesn't take a second argument. The equivalent in
Access would be

Nz(Field1, "aaa") not like "*foreign*"

On the other hand, he could use

(Field1 & "") not like "*foreign*"

(or Tina's suggestion)
 
Top