I have the following DataTable (counting hours of work):
start | end | time
-----------------+------------------+------------------
2009-05-01 08:00 | 2009-05-01 10:00 | 2009-05-01 02:00
2009-05-02 07:30 | 2009-05-02 11:00 | 2009-05-02 03:30
2009-05-03 23:00 | 2009-05-04 02:00 | 2009-05-03 03:00
There's a starttime and an endtime. The third column contains the day and the hours of work.
Is there a nice way to count the hours of work with an aggregate function? The result should be 08:30 in this case.
I am using MS SQL 2005. datetime is not valid for sum(), and the datetime-functions of MS SQL 2005 are very limited compared to MS SQL 2008.
Edit: I can't change the table-layout, and I know it is not well designed.