pre_get_posts query between 2 dates (date stored in custom post meta)

You can always use a BETWEEN comparison in your query, I have used this, maybe you can adapt it to work in your situation. It avoids doing multiple checks for no reason 🙂

$first_date = 110501;
$second_date = 170514;
$meta_query = array(
           'key' => '_exm_date',
           'value' => array($first_date, $second_date ),
           'type' => 'DATE',
           'compare' => 'BETWEEN'
        );

tech