Calculating working hours of employees using time stamps
我在数据库中有四列,其中包括员工姓名、日期和时间的时间戳,它们显示了员工的进出时间。超时在进入后进入下一行,每个员工一天进出很多次,但是我必须考虑每个员工的第一次和最后一次,并找出时间之间的差异计算每个员工的总工作时间。数据库如下所示。谁能帮我解决这个问题
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
E Name Turnstile In Turnstile Out Combine
Abhijit K T SP Turnstile 03 In 2015–01–01 08:08:36 Abhijit K T SP Turnstile 03 In 2015–01–02 08:33:52 Abhijit K T SP Turnstile 01 Out 2015–01–01 18:22:44 Abhijit K T SP Turnstile 03 In 2015–01–01 18:23:00 Abhijit K T SP Turnstile 01 Out 2015–01–02 19:17:08 Abhilash S M SE Turnstile 01 Out 2015–01–02 12:08:08 Abhilash S M SE Turnstile 01 In 2015–01–02 12:13:20 Abhilash S M SE Turnstile 01 Out 2015–01–02 13:07:20 Abhilash S M SE Turnstile 02 In 2015–01–02 13:13:32 Abhilash S M SE Turnstile 01 Out 2015–01–02 13:13:24 Abhilash S M SE Turnstile 03 Out 2015–01–02 14:44:44 Abhilash S M SE Turnstile 01 In 2015–01–02 14:50:16 Abhilash S M SE Turnstile 01 Out 2015–01–02 16:32:24 Abhilash S M SE Turnstile 01 In 2015–01–02 16:37:28 Abhilash S M SP Turnstile 03 In 2015–01–02 08:33:32 Abhilash S M SE Turnstile 01 Out 2015–01–02 18:20:20 Abhilash S M SE Turnstile 01 In 2015–01–02 18:20:28 Abhilash S M SP Turnstile 03 In 2015–01–02 18:25:44 Abhilash S M SP Turnstile 03 Out 2015–01–02 18:28:24 Abhilash S M SP Turnstile 03 In 2015–01–01 10:27:40 Abhilash S M SE Turnstile 01 Out 2015–01–01 12:21:56 |
对我有用
1
2 3 |
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/268507.html