expression error, test for not null

G

Guest

I get an error on this expression. I have a query and I want all records
that are closed cases.
=Is Not Null([Date Close])
How do I test for a not null value?
thanks,
 
G

George Nicholson

I know it seems awkward grammatically, but what you want is:

Not IsNull([Date Close])

HTH,
 
A

Albert D. Kallal

Actually, I write it as:

SELECT ID, Description, Catagory, MyColor
FROM tblAnswers
where mycolor is null;


The above gives all of the null ones....

SELECT ID, Description, Catagory, MyColor
FROM tblAnswers
where mycolor is not null;

The above gives all of the not null ones...

You actually don't want to use a function, as then the indexing, and
"Rushmore" technology in the JET engine can't be used.

eg:

where ucase(lastname) = "kallal"

In the above, the column is wrapped in a function, and thus the index for
that column cannot be used, nor can the sql be optimized.


If you go:

where lastname = "kallal", then of couse a index can be used....

The same goes for the above sql example....you best NOT use a VBA function
to accomplish this. That function isnull() is actually a VBA function, and
not a jet "sql" function. So, insull() is actually using VB to figure out
the expression (this invokes the VBA library).

If you just use "is null", or "is not null", not only does it read better
syntax wise, but then that query can be used in a word merge, and in other
cases where VBA need not be invoked (eg: opening the mdb query via DAO/JET,
or somthing like a word merge).
 

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

Top