SELECT tblDTR.emp_id,
tblEmployee.first_name,
tblEmployee.last_name,
tblDTR.time_out,
tblDTR.time_in
FROM tblDTR
INNER JOIN
tblEmployee
ON tblDTR.emp_id = tblEmployee.emp_id
WHERE (((tblDTR.current_date)=#9/3/2015#));
我只希望记录只包含唯一ID和最早 time_in
值,例如:
EMP1234 - 12:00 AM
EMP12 - 12:45 AM
EMP1 - 7:30 AM (not 12:50 PM)
......按时间顺序排列。
答案 0 :(得分:0)
仅当不存在具有相同emp_id的旧行时,才使用SELECT t1.emp_id,
tblEmployee.first_name,
tblEmployee.last_name,
t1.time_out,
t1.time_in
FROM tblDTR t1
INNER JOIN
tblEmployee
ON t1.emp_id = tblEmployee.emp_id
WHERE (((t1.current_date)=#9/3/2015#))
and NOT EXISTS (select 1 from tblDTR t2
where t2.emp_id = t1.emp_id
and t2.time_in < t1.time_in)
返回行:
UIBezierPath