I have the following query that counts all employees in a specific status, before a specific date. I need to modify with appropriate syntax in Access...what tweaks am I required to make here? Or, is there a more simplistic way to capture the data?
Any help is appreciated! Cheers!
Query:
select Count(*)
from e.history_job j
where j.empl_rcd_nbr = 0
and j.empl_status in ('A','L')
and j.effdt = (select max(j1.effdt)
from e.history_job j1
where j1.emplid = j.emplid
and j1.empl_rcd_nbr = j.empl_rcd_nbr
and j1.effdt <= '31-DEC-06')
and j.effseq = (select max(j2.effseq)
from e.history_job j2
where j2.emplid = j.emplid
and j2.empl_rcd_nbr = j.empl_rcd_nbr
and j2.effdt = j.effdt)
/
Any help is appreciated! Cheers!
Query:
select Count(*)
from e.history_job j
where j.empl_rcd_nbr = 0
and j.empl_status in ('A','L')
and j.effdt = (select max(j1.effdt)
from e.history_job j1
where j1.emplid = j.emplid
and j1.empl_rcd_nbr = j.empl_rcd_nbr
and j1.effdt <= '31-DEC-06')
and j.effseq = (select max(j2.effseq)
from e.history_job j2
where j2.emplid = j.emplid
and j2.empl_rcd_nbr = j.empl_rcd_nbr
and j2.effdt = j.effdt)
/