Date related SQL query, assistance required ;)
-
Hi all,
I am currently using the below to list posts in a particular category:
get_results("SELECT guid, post_title, post_excerpt FROM wp_posts, wp_term_relationships WHERE object_id = ID AND term_taxonomy_id = 1")
It works fine, but I need to be more precise and narrow the results down to certain months using something like…
get_results("SELECT guid, post_title, post_excerpt FROM wp_posts, wp_term_relationships WHERE object_id = ID AND term_taxonomy_id = 1 AND wp_posts.post_date = ??????????")
Could anyone advise how to limit the results returned by year, and by month, using the above SELECT query?
ie, what do I need to add to the SELECT query to limit the results to only posts made in October 2009?
Thanks in advance.
- The topic ‘Date related SQL query, assistance required ;)’ is closed to new replies.