访问数据库检查最小和最大

时间:2013-10-30 07:17:55

标签: ms-access

SELECT ID, Checktime, Checktype
  FROM (SELECT ID,Checktime as Date_IN,Checktype as CheckIn
FROM OT 
  WHERE Checktype='I')  AS TimeIN
Left join
  (SELECT ID  as Emp_Out_ID,Checktime as Date_Out,Checktype as CheckOut
From OT
Where Checktype="O"
group by Emp_Out_ID) as [TimeOut]
on (TimeIN.ID <> TimeOut.Emp_Out_ID
and TimeIN.ID = TimeOut.Emp_Out_ID
group by ID;

我正在尝试过滤掉结果

我在这里做错了什么?

0 个答案:

没有答案