Support

Account

Home Forums General Issues Issue with query between 2 dates Reply To: Issue with query between 2 dates

  • This looks correct, the only thing I can see is that you have

    
    'meta_query' => array(
      'relation' => 'AND',
      array(
        'key' => 'start_date',
        'compare' => '>=',
        'value' => $today,
      ),
      array(
        'key' => 'end_date',
        'compare' => '<=',
        'value' => $today,
      )
    )
    

    so only posts with today’s date in both the start and end date will appear. Maybe you’re not comparing it right. What do you want it to return?