Unanswered: selecting data based on a date range function
I'm trying to fugure out a query that will select records from within a range of two dates using MySQL.
The data I'm trying to represent is for a news page on a website. so I want to have 'current stories' i.e. those from the past 30 days. I'd then like to list the stories that are 30-60 days old and anything else would be in an archive.
I have this query for the 0-30 day old stories:
SELECT headline, dateposted, newsID, flag
WHERE newstype = 9 AND flag = 0 And DATE_ADD(CURDATE(), INTERVAL -30 DAY) <=dateposted
ORDER BY dateposted
this works well, my problem is I can't find any document for choosing data that's between x and y days old.