SELECT A.PERSON_ID , B.OPRID , C.BO_NAME_DISPLAY , A.SUPERVISOR_ID FROM PS_RD_WRKR_JOB A , PS_RD_WRKR_ASGN ASGN , PSOPRALIAS B , PS_BO_NAME C WHERE A.PERSON_ID = ASGN.PERSON_ID AND A.WRKR_ASGN_SEQ = ASGN.WRKR_ASGN_SEQ AND A.WRKR_JOB_SEQ = ASGN.WRKR_JOB_SEQ AND ASGN.ROLE_TYPE_ID IN (86, 87) AND ASGN.PRIMARY_IND = 'Y' AND A.PERSON_ID = B.PERSON_ID AND B.OPRALIASTYPE = 'PER' AND A.BO_ID = C.BO_ID AND C.PRIMARY_IND = 'Y' AND A.EMPL_STATUS = 'A' AND A.EFFDT = ( SELECT MAX(DT.EFFDT) FROM PS_RD_WRKR_JOB DT WHERE A.PERSON_ID = DT.PERSON_ID AND DT.EMPL_STATUS = 'A' AND DT.EFFDT <= %CurrentDateIn)
|