How do I create a dynamic query that filters on month and day? I want to get the list of the nodes, whose content type is Donors, where the date in the field_data_field_donor_date_of_birth matches today (except the year).

How can I achieve it using a dynamic query or the EntityFieldQuery class?

This is the code I tried so far.

$query = db_select('node', 'node');
$query-&gt;fields('node', ['nid','title'])
  -&gt;condition('node.status', 1)
  -&gt;condition('node.type', 'CONTENT_TYPE_DONOR');

$query-&gt;innerJoin('field_data_field_donor_date_of_birth', 
 'field_donor_date_of_birth'
, 'field_donor_date_of_birth.entity_id = node.nid');
$query-&gt;condition('field_donor_date_of_birth.field_donor_date_of_birth_value', $birth_date, '=');

$result = $query-&gt;execute();
I was able to query the date by using a where clause instead of condition.
Example, replace

 $query-&gt;condition('field_donor_date_of_birth.field_donor_date_of_birth_value', $birth_date, '=');


with

$time = format_date(time(), 'custom', 'm-d');
$query-&gt;where("DATE_FORMAT(field_donor_date_of_birth.field_donor_date_of_birth_value, '%m-%d') = '$time'");