0

Hi I'm trying to display wordpress posts in October 2010.

My best attempt was SELECT * FROM 'wp_posts' WHERE 'post_date' < 31/10/2010;

but it shows an empty result and I think the dates need to be in a range.
Any suggestions?


Thanks,

Kevin

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by smantscheff
0

I don't know wordpress but I would assume they use date type fields for dates. In that case you have to format your input date accordingly:
SELECT * FROM 'wp_posts' WHERE 'post_date' < '2010-10-31';

0

Solved it. The single quotes were causing some problems.
The correct code for my problem is:

SELECT * FROM wp_posts WHERE post_date BETWEEN '2010-10-01' AND '2010-10-31' :)

Have a good day!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.