Sql by date custom fields wordpress
-
I have this SQL query that extracts the year and month of ” post_date ” posts
$query = "SELECT YEAR(post_date) asyear, MONTH(post_date) asmonth`
FROM $wpdb->posts
WHEREpost_type= ‘$t’
ANDpost_status= ‘publish’
GROUP BYyear,month
ORDER BYyearDESC,monthASC”;`but I wonder , how I can do the same query but instead of ” post_date ” would be a date field created by the custom fields plugin.
Thank you
The topic ‘Sql by date custom fields wordpress’ is closed to new replies.