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

  • Thread starter Thread starter Bill Mitchell
  • Start date Start date
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.
 
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])
 
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
 
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.


.
 
Back
Top