SELECT A.CAL_ID ,B.EMPLID ,B.EMPL_RCD ,B.SETID_JOBCODE ,C.JOBCODE ,C.DESCR FROM PS_GP_CALENDAR A ,PS_JOB B ,PS_JOBCODE_TBL C WHERE A.GP_PAYGROUP = B.GP_PAYGROUP AND B.EFFDT = ( SELECT MAX(A_ED.EFFDT) FROM PS_JOB A_ED WHERE A_ED.EMPLID = B.EMPLID AND A_ED.EMPL_RCD = B.EMPL_RCD AND A_ED.EFFDT <= A.PYMT_DT) AND B.EFFSEQ = ( SELECT MAX(A_ES.EFFSEQ) FROM PS_JOB A_ES WHERE A_ES.EMPLID = B.EMPLID AND A_ES.EMPL_RCD = B.EMPL_RCD AND A_ES.EFFDT = B.EFFDT) AND C.SETID = B.SETID_JOBCODE AND C.JOBCODE = B.JOBCODE AND C.EFFDT = ( SELECT MAX(JC.EFFDT) FROM PS_JOBCODE_TBL JC WHERE JC.SETID = C.SETID AND JC.JOBCODE = C.JOBCODE AND JC.EFFDT <= A.PYMT_DT)
|