Home › Forums › Add-ons › Repeater Field › Show only start and end dates after today from repeater field › Reply To: Show only start and end dates after today from repeater field
I’ve updated this to have the SQL query take care of the date issues, so it’s now:
SELECT A.post_id, A.meta_value as startdate, B.meta_value as enddate FROM wac_n06_postmeta as A JOIN wac_n06_postmeta as B on A.post_id WHERE A.post_id = B.post_id AND A.meta_value > CURDATE() AND A.meta_key LIKE 'tour_dates_%_tour_start' AND B.meta_key LIKE 'tour_dates_%_tour_end' AND SUBSTRING(B.meta_key,12,5) = SUBSTRING(A.meta_key,12,5)
But I still haven’t worked out how to make the matching bit less hacky.
Any help much appreciated!
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!
❓Ever wondered when and why ACF uses JSON instead of the database? Check out our summary of the most recent session of ACF Chat Friday for the answer, and make sure to register for the next session.— Advanced Custom Fields (@wp_acf) February 23, 2023
© 2023 Advanced Custom Fields.