Hi,
I have two tables TimeSheet and TimeRecord. TimeRecord has Foreign Key TimeSheetId of TimeSheet. The following time-logs are from TimeRecord,
TimeSheet sample data:
TimeSheetId, StudentId
- 187 , 10
- 196 , 11
- 195 , 12
TimeRecord sample data:
TimeRecordId, TimeSheetId, TimeIn, TimeOut
- 1 , 187 , 8/17/2010 1:06:55 PM , 8/17/2010 1:53:49 PM
- 2 , 196 , 8/17/2010 1:31:28 PM , 8/17/2010 4:59:58 PM
- 3 , 187 , 8/17/2010 1:51:40 PM , 8/17/2010 4:59:02 PM
- 4 , 187 , 8/17/2010 2:13:35 PM , 8/17/2010 5:00:08 PM
- 5 , 196 , 8/17/2010 2:19:44 PM , 8/17/2010 5:00:14 PM
- 6 , 196 , 8/17/2010 2:23:02 PM , 8/17/2010 4:46:00 PM
- 7 , 195 , 8/17/2010 3:04:15 PM , 8/17/2010 4:58:34 PM
I'd like to get total time spent of each student. So, the result will be like something's like the following:
- 10 has 10hr 30mn 5sec
- 11 has 8hr 45mm 23sec
- 12 has 2hr 33mn 25sec
Thanks a lot.