SELECT B.SETID ,C.CATEGORY_ID ,B.INV_ITEM_ID ,D.LANGUAGE_CD ,D.DESCR FROM PS_INV_ITEMS A , PS_PURCH_ITEM_ATTR B , PS_MASTER_ITEM_TBL C , PS_PURCH_ITEM_LANG D WHERE A.SETID = B.SETID AND A.INV_ITEM_ID = B.INV_ITEM_ID AND A.SETID = C.SETID AND A.INV_ITEM_ID = C.INV_ITEM_ID AND A.SETID = D.SETID AND A.INV_ITEM_ID = D.INV_ITEM_ID AND C.itm_status_current IN ('1','2','3','4') AND A.EFFDT = ( SELECT MAX(EFFDT) FROM PS_INV_ITEMS C WHERE C.SETID = B.SETID AND C.INV_ITEM_ID = B.INV_ITEM_ID AND EFFDT <= %CurrentDateIn) AND ((%CurrentDateIn >= B.PO_AVAIL_DT) AND (B.PO_UNAVAIL_DT > %CurrentDateIn))
|