SELECT A.EMPLID , %Dttm(A.EFFDT, %TIMEIN('23.59.00.000000')) FROM %Table(JOB) A , %Table(RS_WRKR_EFFDT) B WHERE A.EMPLID = B.EMPLID AND B.SYSTEM_SOURCE = 'RS' AND B.EFFDT = ( SELECT MAX(D.EFFDT) FROM %Table(RS_WRKR_EFFDT) D WHERE D.EMPLID = B.EMPLID AND D.SYSTEM_SOURCE = B.SYSTEM_SOURCE) AND A.EMPL_RCD = B.EMPL_RCD AND %EffdtCheck(JOB E, A, %CurrentDateIn) AND A.EFFSEQ = ( SELECT MAX(F.EFFSEQ) FROM %Table(JOB) F WHERE F.EMPLID = A.EMPLID AND F.EMPL_RCD = A.EMPL_RCD AND F.EFFDT = A.EFFDT) AND A.EMPL_STATUS IN ('I','T','S','D','U','V')
|