Hi
I have a table containing the data a person has entered into the system e.g.
Agent|StartTime|EndTime
Bob|2009-01-22 09:59:59|2009-01-22 10:30:41
Bob|2009-01-22 10:44:59|2009-01-22 10:55:41
Bob|2009-01-22 11:02:59|2009-01-22 11:37:41
Bob|2009-01-22 11:42:59|2009-01-22 12:10:41
what i am looking to get out of the system is the following breakdown:
Agent|From|To|Duration
Bob|2009-01-22 09:00:00|2009-01-22 10:00:00|00:52:00 (This value should not be more than an hour)
Im not sure how i can do this, as grouping by datepart(hour,starttime) will mean if a rcord is entered near the end of the hour it will mean that hour will total over 1 hour,
Many thanks
I have a table containing the data a person has entered into the system e.g.
Agent|StartTime|EndTime
Bob|2009-01-22 09:59:59|2009-01-22 10:30:41
Bob|2009-01-22 10:44:59|2009-01-22 10:55:41
Bob|2009-01-22 11:02:59|2009-01-22 11:37:41
Bob|2009-01-22 11:42:59|2009-01-22 12:10:41
what i am looking to get out of the system is the following breakdown:
Agent|From|To|Duration
Bob|2009-01-22 09:00:00|2009-01-22 10:00:00|00:52:00 (This value should not be more than an hour)
Im not sure how i can do this, as grouping by datepart(hour,starttime) will mean if a rcord is entered near the end of the hour it will mean that hour will total over 1 hour,
Many thanks