12

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

Thanks

Kunal Deo
  • 2,248
  • 2
  • 18
  • 27

1 Answers1

22

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.

Brian Willis
  • 22,768
  • 9
  • 46
  • 50
  • Just figured out that this comparison also considers a text field to be null if text_field = ' '. Kinda like the String.IsBlank() – Adrian Carr Apr 10 '14 at 13:23