null values in querys?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know its (Nz(field)) in VBA but what is the correct syntax for specifiying
a null value in a query?

For my example I need to specify IF the value is null to update it with info.


Thanks!
 
I know its (Nz(field)) in VBA but what is the correct syntax for specifiying
a null value in a query?

Actually it isn't. NZ() is a function which will *convert* a NULL value to
something else. The VBA function to *ascertain* whether or not a variable is
NULL is

IsNull()
For my example I need to specify IF the value is null to update it with info.

A query criterion of

IS NULL

will do the trick. Note that = NULL or <> NULL or any other comparison
operator with NULL will return NULL as a result (and not retrieve the record);
the only valid criteria are IS NULL or IS NOT NULL.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top