Home › Forums › General Issues › Query not running as expected › Reply To: Query not running as expected
The return value doe not matter and the “type” value of the field in the meta query cannot be “DATE”. You must query using the format the ACF stores in the DB. In ACF a date field is always stored in the format “Ymd”. Because this is not a valid DB Date format the field type must be set to “NUMERIC” or “CHAR”.
$dateToday = date('Ymd');
......
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'film_releasedate',
'value' => $dateToday,
'compare' => '>',
),
array(.........
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.