SELECT A.BUSINESS_UNIT , A.PROJECT_ID , A.PROJECT_MANAGER , %Substring((%TrimSubstr(PERS.FIRST_NAME, 1, 30) %Concat ' ' %Concat %TrimSubstr(PERS.LAST_NAME, 1, 30)), 1, 50) FROM PS_PROJECT_MGR A , PS_PERS_DATA_EFFDT PERS WHERE PERS.EMPLID = A.PROJECT_MANAGER AND A.EFFDT = ( SELECT MAX(B.EFFDT) FROM PS_PROJECT_MGR B WHERE A.BUSINESS_UNIT = B.BUSINESS_UNIT AND A.PROJECT_ID = B.PROJECT_ID AND B.EFFDT <= %CurrentDateIn) AND PERS.EFFDT = ( SELECT MAX(C.EFFDT) FROM PS_PERS_DATA_EFFDT C WHERE C.EMPLID = PERS.EMPLID AND C.EFFDT <= %CurrentDateIn)
|