I am trying to perform a query as listed below (notice the check for NULL)
$query = db_select('node', 'n');
/* add fields and joins... */
$query->condition(db_or()
->condition(db_and()
->condition('join_alias1.field_date_unassigned_value', NULL, 'IS')
->condition('join_alias2.field_date_assigned_value', $end_date, '<='))
->condition(db_and()
->condition('join_alias1.field_date_unassigned_value', $start_date, '>=')
->condition('join_alias2.field_date_assigned_or_submitted_value', $end_date, '<=')));
I am aware that Drupal expects Null values to be checked like
$query->isNull('myfield');
But I don't understand how to perform a query like I listed above while using $query->isNull()
.
Any ideas? Thanks