This question follows on from: https://wordpress.stackexchange.com/questions/11390/can-you-do-a-date-comparison-on-a-custom-field-and-query-two-or-more-custom-taxo
and a similar thing here: https://stackoverflow.com/questions/7080352/multiple-custom-fields-stored-as-meta-keys-how-to-connect-with-the-post/
I'm trying to compare a start and end date which are custom fields in a post type of exhibitions which is set up using a jquery date picker with dateFormat : 'dd-mm-yy'
$today = date('Y-m-d', strtotime('-6 hours'));
$args = array(
'showposts' => 1,
'orderby' => rand,
'post_type' => 'exhibition',
'meta_query' => array(
relation' => 'AND',
array(
'key' => 'startDate',
'type' => 'CHAR',
'value' => $today,
'compare' => '>='
),
array(
'key' => 'endDate',
'type' => 'CHAR',
'value' => $today,
'compare' => '<='
),
)
);
What I don't understand is how this is being saved into the meta data - presumably it will be type CHAR and why my query doesn't seem to work correctly