I have 2 fields in a node and I'm trying to get the expired nodes set in "Start Date" and "End Date" field.
I'm using db_select to get the start and end date values.
How can I add a condition to check if the dates are in range?
Here's my current code:-
$query = db_select('node__field_end_date', 'ed');
$query->leftJoin('node__field_start_date', 'sd', 'sd.entity_id = ed.entity_id');
// Date values showing as a formatted date
$query->addField('ed', 'node__field_end_date', 'date_end');
$query->addField('sd', 'field_start_date_value', 'date_start');