I am trying to pull the amount of time each employee worked in each period. Then total them for each WorkCode.
Example: The employee worked 49:41 before they clocked a 15 Break.
EmpID
WorkCode
WorkDesc
DateTm
23
2
Work
3/12/2013 8:06:02
23
2
Work
3/12/2013 8:42:12
23
5
15 Break
3/12/2013 8:55:43
23
2
Work
3/12/2013 9:09:52
23
2
Work
3/12/2013 10:37:27
23
2
Work
3/12/2013 11:24:01
23
7
Lunch
3/12/2013 12:03:42
23
2
Work
3/12/2013 13:01:47
23
2
Work
3/12/2013 14:32:31
23
5
15 Break
3/12/2013 15:03:45
23
2
Work
3/12/2013 15:18:50
I tried using Autonumber but it generated teh _AutoNumberSerial below.
Work:
Load *,
AutoNumber(EmpID & WorkCode, '_WorkSerial') as _WorkCodeSerial
Resident tWork
Order by EmpID , DateTm;
EmpID
WorkCode
WorkDesc
DateTm
_AutoNumberSerial
_DesiredSerial
23
2
Work
3/12/2013 8:06
1
1
23
2
Work
3/12/2013 8:42
1
1
23
5
15 Break
3/12/2013 8:55
2
2
23
2
Work
3/12/2013 9:09
1
3
23
2
Work
3/12/2013 10:37
1
3
23
2
Work
3/12/2013 11:24
1
3
23
7
Lunch
3/12/2013 12:03
3
4
23
2
Work
3/12/2013 13:01
1
5
23
2
Work
3/12/2013 14:32
1
5
23
5
15 Break
3/12/2013 15:03
2
6
23
2
Work
3/12/2013 15:18
1
7
I was trying to get the _DesiredSerial. I figure I could combine the WorkCode & _DesiredSerial and then get the min and max times grouped by the new combined value.
I would greatly appreciate the help. If you know of a better way to pull these values than what I have proposed that would be great as well.