任何人都可以帮助我。我试图在两个单独的记录中计算记录条目1和记录条目2之间的差异以及日期和时间等等
我想添加另一行来计算条目1和条目2之间的差异。我知道如果我确实已经签入并退房,那么我可以从时间中减去时间并将其排序。但是从来没有尝试过记录
更新我正在使用的代码是:
SELECT USERINFO.name, CHECKINOUT.CHECKTIME
FROM CHECKINOUT, USERINFO
WHERE (((USERINFO.name)=[Enter Name]))
ORDER BY CHECKINOUT.CHECKTIME DESC;
答案 0 :(得分:0)
Select
name,
DateValue(CHECKTIME) AS Date,
TimeValue(CHECKTIME) AS Time
From CHECKOUT
答案 1 :(得分:0)
可能是:
Select *,
(CheckTime - (Select Top 1 CheckTime
From [Employee Check] As T
Where T.Name = [Employee Check].Name
And T.CheckTime < [Employee Check].CheckTime
Order By T.CheckTime Desc)) As CheckTimeDiff
From [Employee Check]