如何在上午5:00到次日凌晨5:00之间进行查询以获取InTime和OutTime? [英] How to make a query in access to get InTime and OutTime Between 5:00 am and next day 5:00am?
问题描述
我正在使用MS access 2010.
我需要在今天凌晨5点到明天凌晨5点之间获得InTime和OutTime。因为有些员工今天早上会来,比如说,早上10点,可能会在第二天凌晨2点离开办公室。所以我需要计算他/她的实时和停工时间。
使用的查询是:
SELECT DateValue(Trans.Dt)AS DateOfAttendance,Format(Min(Trans.Dt),MM / dd / yyyy HH:mm:ss)AS InTime,格式(Max(Trans.Dt),MM / dd / yyyy HH :mm:ss)AS OutTime,EmpID FROM Trans WHERE(DateValue(Trans.Dt)= date())GROUP BY DateValue(Trans.Dt),Trans.EmpID;
在此先感谢!!!
I am using MS access 2010.
I need to get the InTime and OutTime between the timing 5am today till 5am tomorrow. Because some employee will come by today morning,say,10:00 am and may leave the office by next day morning 2:00 am. so I need to calculate his/her intime and outtime.
The query used is:
SELECT DateValue(Trans.Dt) AS DateOfAttendance, Format(Min(Trans.Dt) ,"MM/dd/yyyy HH:mm:ss") AS InTime, Format(Max(Trans.Dt),"MM/dd/yyyy HH:mm:ss") AS OutTime, EmpID FROM Trans WHERE (DateValue(Trans.Dt)=date()) GROUP BY DateValue(Trans.Dt),Trans.EmpID;
Thanks in Advance!!!
推荐答案
您已获得解决方案的链接,请继续尝试。
You have been given a link to a solution, please go and try it.
>
这篇关于如何在上午5:00到次日凌晨5:00之间进行查询以获取InTime和OutTime?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!