I am in the process of doing some point in time reporting and am having difficulty identifying all the data on row 'As of' a specific date.
For instance, I need to identify an Employee's status As of a specific date.
The query below identifies the maximum effective date and corresponding data on the row...how can add a WHERE clause to look for the 'As Of' date?
SELECT A.EMPLID, A.EFFDT, A.EMPL_STATUS
FROM PS_JOB AS A INNER JOIN [SELECT EMPLID, Max(EffDt) As LastDate FROM JOB GROUP BY EMPLID]. AS L ON (A.EffDt = L.LastDate) AND (A.EMPLID = L.EMPLID);
For instance, I need to identify an Employee's status As of a specific date.
The query below identifies the maximum effective date and corresponding data on the row...how can add a WHERE clause to look for the 'As Of' date?
SELECT A.EMPLID, A.EFFDT, A.EMPL_STATUS
FROM PS_JOB AS A INNER JOIN [SELECT EMPLID, Max(EffDt) As LastDate FROM JOB GROUP BY EMPLID]. AS L ON (A.EffDt = L.LastDate) AND (A.EMPLID = L.EMPLID);