in reply to sorting mysql by week and year

This isn't really a Perl question, but a SQL one. You don't need to worry about how the data is STORED, but how it is retrieved.

Store it as whatever timestamp like value you want and then when you pull the data out to present it to the user you'll need to qualify your SELECT statement to only include the rows that match what you want. I'm not very familiar with MySQL, but it should be something like this:

SELECT * FROM table WHERE date = 'today'; SELECT * FROM table WHERE date >= '08-01-2006' # 7 days ago SELECT * FROM table WHERE date >= '08-08-2005' # 12 months ago

Frank Wiles <frank@revsys.com>
www.revsys.com