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

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';

Thanks for the reply but still nothing. :(

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!

Please mark this thread as solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.