Entity query to select current dates The situation: I have a drupal 7 node which has a date field. This uses the date module and it has multiple values each with a start and end date. 

The problem is that I want to query drupal for all nodes where the current date is between the start and end dates of a single delta.

The entity query I have at the moment doesn't check the same value for both start and end dates.

For example if the first date value started 1/1/2013 and ended 30/1/2013 and if there was a second value which started 1/12/2013 and ended 30/12/2013. Using the current date of today 11/10/2013 this node should NOT be fetched. However under the query below it is because there is a start date in the past and an end date in the future, even though they're not from the same field delta.

  $current_date = date("Y-m-d");

  $query = new EntityFieldQuery();
  $query-&gt;entityCondition('entity_type', 'node')
    -&gt;entityCondition('bundle', RD_PRIZE_DRAW_NODE_TYPE);
    -&gt;fieldCondition('field_rd_prize_draw_dates', 'value', $current_date, '&lt;=')
    -&gt;fieldCondition('field_rd_prize_draw_dates', 'value2', $current_date, '&gt;=');
    -&gt;execute();
Having actually read the fieldCondition documentation the fourth property turns out to be $delta_group which allows specifying dependent conditions. So it turns out all I needed was the below:

$current_date = date("Y-m-d H:i:s");
$query = new EntityFieldQuery();
  $query-&gt;entityCondition('entity_type', 'node')
    -&gt;entityCondition('bundle', RD_PRIZE_DRAW_NODE_TYPE);
    -&gt;fieldCondition('field_rd_prize_draw_dates', 'value', $current_date, '&lt;=', 1)
    -&gt;fieldCondition('field_rd_prize_draw_dates', 'value2', $current_date, '&gt;=', 1);
    -&gt;execute();