Checking for Blank Date field in Salesforce

Kunal Deo picture Kunal Deo · Apr 26, 2011 · Viewed 19.1k times · Source

How do I check if a field is Blank in Salesforce using SOQL.

Thanks

Answer

Brian Willis picture Brian Willis · Apr 26, 2011

SOQL has support for NULL values, so you should be able to query as you do with regular SQL. For example:

SELECT column
FROM table
WHERE date_field = NULL

Notice the use of = NULL instead of IS NULL as you would find in SQL.