SELECT H.EMPLID , H.NAME_DISPLAY ,B.EMPLOYEE_PHOTO ,C.DESCR FROM PS_PERSON_NAME H , %Table(USER_PH_LIST_FL) B ,PS_JOB JOB ,PS_JOBCODE_TBL C WHERE H.EMPLID = B.EMPLID AND JOB.EMPLID = H.EMPLID AND JOB.EMPL_RCD = 0 AND JOB.SETID_JOBCODE = C.SETID AND JOB.JOBCODE = C.JOBCODE AND C.EFF_STATUS = 'A' AND %EffdtCheck(JOBCODE_TBL, C, %CurrentDateIn) AND JOB.EFFDT=( SELECT MAX(EFFDT) FROM PS_JOB JOB2 WHERE JOB.EMPLID=JOB2.EMPLID AND JOB.EMPL_RCD=JOB2.EMPL_RCD AND JOB2.EFFDT<=%CurrentDateIn) AND JOB.EFFSEQ = ( SELECT MAX(EFFSEQ) FROM PS_JOB WHERE EMPLID = JOB.EMPLID AND EMPL_RCD = JOB.EMPL_RCD AND EFFDT = JOB.EFFDT)
|