本文介绍了在我希望加班的行之间.........的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个查询给出了时间和时间,但我想要总时间和晚上时间....



this query give intime and outtime but i want total time and late time aslo....

select distinct CE.USERID, CONVERT(Date,Localtimestamp) as LocalTime,
(select min(TIMESTAMPS) from access_event_logs As MINCE
where CAST(MINCE.TIMESTAMPS as DATE)=CAST(CE.TIMESTAMPS As DATE) AND MINCE.EVENTID ='In' and MINCE.USERID=CE.USERID) As MinTime,
(select max(TIMESTAMPS) from access_event_logs As MAXCE
where CAST(MAXCE.TIMESTAMPS as DATE)=CAST(CE.TIMESTAMPS As DATE) AND MAXCE.EVENTID ='Out' and MAXCE.USERID=CE.USERID) As MaxTime from access_event_logs As CE
WHERE USERID='019' AND Convert(date,LOCALTIMESTAMP) between '3/1/2014' and '3/18/2014'







019 2014-03-02  2014-03-02 07:56:01.000 2014-03-02 14:45:47.000
019 2014-03-03  2014-03-03 07:58:58.000 2014-03-03 14:31:31.000
019 2014-03-04  2014-03-04 07:49:09.000 2014-03-04 14:43:01.000
019 2014-03-05  2014-03-05 07:50:08.000 2014-03-05 14:51:01.000
019 2014-03-06  2014-03-06 07:50:48.000 2014-03-06 17:02:39.000
019 2014-03-09  2014-03-09 07:43:37.000 2014-03-09 14:34:59.000
019 2014-03-10  2014-03-10 07:43:34.000 2014-03-10 14:30:24.000
019 2014-03-11  2014-03-11 07:45:31.000 2014-03-11 14:33:05.000
019 2014-03-12  2014-03-12 07:47:59.000 2014-03-12 14:30:55.000
019 2014-03-13  2014-03-13 07:37:54.000 2014-03-13 14:38:10.000
019 2014-03-16  2014-03-16 07:46:48.000 2014-03-16 14:29:25.000
019 2014-03-17  2014-03-17 07:53:28.000 2014-03-17 14:26:46.000
019 2014-03-18  2014-03-18 08:29:18.000 2014-03-18 14:34:29.000







i想要在行之间(intime和outtime)计算总时间和延迟时间

我的办公时间7:30到2:30




i want between the row (intime and outtime) calculate total time and late time
my office timing 7:30 to 2:30

推荐答案

这篇关于在我希望加班的行之间.........的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 07:17