[UPHPU] Database question

Alvaro Carrasco alvaro at epliant.com
Thu Jan 15 18:28:25 MST 2009


Scott Hill wrote:
> I have a table with a datetime column and I want to group by week.  Any
> ideas on how to do this with a MySQL query?  The table has a timein column,
> a timeout column and a column called elapsed.  I want to sum the elapsed for
> each week.  I know I can do this in the where clause by specifying a date
> range but it is possible to do this with group by?
> 
> Thanks,
> 

Have you tried:

GROUP BY YEARWEEK(mydatetimecolumn)

Alvaro


More information about the UPHPU mailing list