SELECT J.EMPL_ID_RCD , D.LANGUAGE_CD , D.Descr , C.Descr FROM PS_WCS_ECM_JOB J , PS_DEPT_TBL_LANG D , PS_JOBCODE_LANG C WHERE J.SETID_JOBCODE = C.SETID AND J.JOBCODE = C.JOBCODE AND J.SETID_DEPT = D.SETID AND J.DEPTID = D.DEPTID AND D.EFFDT =( SELECT MAX(X.EFFDT) FROM PS_DEPT_TBL_LANG X WHERE X.SETID=D.SETID AND X.DEPTID=D.DEPTID AND X.EFFDT <= %CurrentDateIn) AND C.EFFDT = ( SELECT MAX(X.EFFDT) FROM PS_JOBCODE_TBL X WHERE X.SETID=C.SETID AND X.JOBCODE=C.JOBCODE AND X.EFFDT <= %CurrentDateIn) UNION SELECT J.EMPL_ID_RCD , D.LANGUAGE_CD , D.Descr , ' ' FROM PS_WCS_ECM_JOB J , PS_DEPT_TBL_LANG D WHERE J.SETID_DEPT = D.SETID AND J.DEPTID = D.DEPTID AND D.EFFDT = ( SELECT MAX(X.EFFDT) FROM PS_DEPT_TBL_LANG X WHERE X.SETID=D.SETID AND X.DEPTID=D.DEPTID AND X.EFFDT <= %CurrentDateIn) UNION SELECT J.EMPL_ID_RCD , C.LANGUAGE_CD , ' ' , C.Descr FROM PS_WCS_ECM_JOB J , PS_JOBCODE_LANG C WHERE J.SETID_JOBCODE = C.SETID AND J.JOBCODE = C.JOBCODE AND C.EFFDT = ( SELECT MAX(X.EFFDT) FROM PS_JOBCODE_TBL X WHERE X.SETID=C.SETID AND X.JOBCODE=C.JOBCODE AND X.EFFDT <= %CurrentDateIn)
|