Wednesday, October 22, 2014

Time on Task

Hello,


What is the best way to calculate the amount of time spent on task for each user, when there are multiple start and stop times, and those times span one or more days?


Here is my table structure


CREATE TABLE [dbo].[CA](


[CAID] [int] NOT NULL,

[DateStarted] [int] NULL,

[TimeStarted] [int] NULL,

[DateEnded] [int] NULL,

[TimeEnded] [int] NULL,

[UpdateDateTime] [int] NULL,

[UserID] [int] NULL

)


and here is an example of data.


CAID UserIDStartD StartTEndD EndT

00000000300000700767 000000200000000000192014-09-26 07:10:57.95300002014-09-26 07:25:08.5470000

00000000300000700767 000000003000002849282014-09-24 12:49:52.07300002014-09-24 13:42:24.2570000

00000000300000700767 000000003000002849282014-09-23 17:18:23.26300002014-09-23 17:26:33.6000000

00000000300000700767 000000003000002849282014-09-23 16:25:21.04700002014-09-23 17:16:13.1700000

00000000300000700767 000000003000003069582014-09-05 10:33:36.39700002014-09-05 10:49:17.0500000


Thanks in advance to anyone who can assist!!




Bob


No comments:

Post a Comment