I want to select all the records in a table that have a date (not a timestamp) within a range of 7 days. I have a weekly school newsletter (published every Friday) that I want to include the next week's sports schedule on. I store the newsletter date in a table. After I print all the school news, I want to display the all the games for the upcoming week. Say the newsletter date is 1/10/2003. I want to go to the sports table and select all games whose dates are from 1/10/2003 to 1/16/2003. Would I use the TO_DAYS mySQL function for this? Something like:
SELECT * FROM athletics
WHERE TO_DAYS(gamedate) >= TO_DAYS(gamedate)
AND gamedate <= TO_DAYS(gamedate) +7;
Any other suggestions would be greatly appreciated.
BTW, game date is stored YYYY-MM-DD