I am running a meta query to pull out past custom post types (named 'show') between two dates.
The dates are any show between the 1st jan 2000 and 31st dec 2009
$end_2000s = '20091231';
$start_2000s = '20000101';
$row = 1;
$args = array(
'post_type' => 'show',
'posts_per_page' => -1,
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'from_date',
'compare' => '>=',
'value' => $start_2000s,
),
array(
'key' => 'from_date',
'compare' => '<=',
'meta_value' => $end_2000s,
)
),
'order' => 'ASC',
'meta_key' => 'from_date',
'orderby' => 'meta_value',
);
What I get is shows between 2000-01-01 and the date today (2019-02-11)
TIA.