SELECT A.BUSINESS_UNIT , A.COMMON_ID , A.COMMON_ID , F.NAME , C.DESCR , A.POSTED_DATE , A.ITEM_EFFECTIVE_DT , A.LINE_AMT , 0 FROM PS_ITEM_LINE_SF A , PS_ITEM_SF B , PS_ITEM_TYPE_TBL C , PS_BUS_UNIT_TBL_SF D , PS_SCC_PRI_NAME_VW F WHERE A.BUSINESS_UNIT = B.BUSINESS_UNIT AND A.COMMON_ID = B.COMMON_ID AND A.SA_ID_TYPE = B.SA_ID_TYPE AND A.ITEM_NBR = B.ITEM_NBR AND A.SA_ID_TYPE = 'P' AND A.BUSINESS_UNIT = D.BUSINESS_UNIT AND B.ITEM_TYPE = C.ITEM_TYPE AND C.EFFDT = ( SELECT MAX(E.EFFDT) FROM PS_ITEM_TYPE_TBL E WHERE C.SETID = E.SETID AND C.ITEM_TYPE = E.ITEM_TYPE AND E.EFFDT <= %CurrentDateIn) AND C.SETID = ( SELECT SETID FROM PS_SET_CNTRL_REC E WHERE E.SETCNTRLVALUE = D.INSTITUTION AND E.RECNAME = 'ITEM_TYPE_TBL') AND A.COMMON_ID = F.EMPLID
|