SELECT DISTINCT PPS.CAL_RUN_ID , L.LOCATION , L.LANGUAGE_CD , L.DESCR FROM PS_GP_PYE_PRC_STAT PPS , PS_JOB JOB , PS_LOCATION_LANG L WHERE PPS.EMPLID=JOB.EMPLID AND PPS.EMPL_RCD=JOB.EMPL_RCD AND JOB.EFFDT = ( SELECT MAX(JJ.EFFDT) FROM PS_JOB JJ WHERE JJ.EMPLID=PPS.EMPLID AND JJ.EMPL_RCD=PPS.EMPL_RCD AND JJ.EFFDT <= PPS.PRD_END_DT) AND JOB.LOCATION=L.LOCATION AND L.EFFDT = ( SELECT MAX(LL.EFFDT) FROM PS_LOCATION_LANG LL WHERE L.LOCATION = LL.LOCATION AND L.LANGUAGE_CD=LL.LANGUAGE_CD AND LL.EFFDT <= %CurrentDateIn)
|