SELECT DISTINCT Format([TIME],"YYYY-MM-DD") AS 日期, Format(DMin("time","考勤表","Format([TIME],'YYYY-MM-DD')='" & [日期] & "' AND CODE='" & [CODE] & "'"),'hh:nn') AS 最早, Format(DMax("time","考勤表","Format([TIME],'YYYY-MM-DD')='" & [日期] & "' AND CODE='" & [CODE] & "'"),'hh:nn') AS 最晚, 考勤表.CODE AS 工号
FROM 考勤表
ORDER BY 考勤表.CODE