TitleistDBA
IS-IT--Management
I have a table that has multiple clocknum's. I am looking for the most recent record for each clocknum. I am trying to get it by a datetime field called EFFDT. For some reason I am only getting back one record. Shouldn't this query return me a record for each clocknum?
SELECT a.clocknum, a.EFFDT
FROM employee_dump_tbl a, employee_dump_tbl b
WHERE a.clocknum = b.clocknum
and a.EFFDT = (SELECT MAX(EFFDT) from employee_dump_tbl)
and empl_action not in ('REC')
Thanks for the help.
SELECT a.clocknum, a.EFFDT
FROM employee_dump_tbl a, employee_dump_tbl b
WHERE a.clocknum = b.clocknum
and a.EFFDT = (SELECT MAX(EFFDT) from employee_dump_tbl)
and empl_action not in ('REC')
Thanks for the help.