List of Dates Grouped by Week

2004-10-26 Thread shaun thornburgh
Hi, I am creating an online timesheet application. Most parts are done, however I have a problem displaying a list of unapproved timesheets. Here is my timesheet table: mysql DESCRIBE Timesheets; +---+-+--+-+++ | Field |

Re: List of Dates Grouped by Week

2004-10-26 Thread Dobromir Velev
Hi, You can use the WEEK function http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html and the query will look like select week(Date) as weekID,User_ID,sum(hours) from Timesheets group by weekID,User_ID order by weekID; You will have to do some additional math in your application to