SELECT DISTINCT D.CATEGORY_CD , D.DESCR60 , B.CATEGORY_ID FROM PS_DEM_CHG_INF_INV A , PS_PL_BU_ITEMS B , PS_SET_CNTRL_REC C , PS_ITM_CAT_TBL D WHERE A.INV_ITEM_ID =B.INV_ITEM_ID AND A.DESTIN_BU = C.SETCNTRLVALUE AND C.RECNAME = 'ITM_CAT_TBL' AND C.SETID = D.SETID AND C.SETCNTRLVALUE = B.BUSINESS_UNIT AND B.CATEGORY_ID = D.CATEGORY_ID AND D.EFFDT = ( SELECT MAX(D1.EFFDT) FROM PS_ITM_CAT_TBL D1 WHERE D1.SETID = D.SETID AND D1.CATEGORY_TYPE = D.CATEGORY_TYPE AND D1.CATEGORY_ID = D.CATEGORY_ID AND D1.EFF_STATUS = 'A' AND D1.EFFDT <= %CurrentDateIn)
|