Is there a way to do "IsNotNull"???

B

Bill Mitchell

I am writing a query and I want to include a field to
sort on ONLY if its value IS NOT NULL. I can see how to
check if it is Null, but what do I write to check if it
Is Not Null. I've looked all over through help and can't
find a solution to this easy problem.
 
A

Allen Browne

In the context of a query (including the WhereCondition for
OpenForm/OpenReport, or the 3rd argument for a domain aggregate function),
you can use:
[MyField] Is Not Null

In the context of VBA code, you need to use:
Not IsNull([MyField])
 
R

Rick Brandt

Bill Mitchell said:
I am writing a query and I want to include a field to
sort on ONLY if its value IS NOT NULL. I can see how to
check if it is Null, but what do I write to check if it
Is Not Null. I've looked all over through help and can't
find a solution to this easy problem.

IS NOT NULL

....is the correct syntax.

SELECT * FROM SomeTable
WHERE SomeField Is Not Null
 
B

Bill Mitchell

Thanks once again Allen,

Your posts are always excellent.

Bill
-----Original Message-----
In the context of a query (including the WhereCondition for
OpenForm/OpenReport, or the 3rd argument for a domain aggregate function),
you can use:
[MyField] Is Not Null

In the context of VBA code, you need to use:
Not IsNull([MyField])

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I am writing a query and I want to include a field to
sort on ONLY if its value IS NOT NULL. I can see how to
check if it is Null, but what do I write to check if it
Is Not Null. I've looked all over through help and can't
find a solution to this easy problem.


.
 

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