SELECT A.BUSINESS_UNIT ,A.COMMON_ID ,A.ITEM_NBR ,D.LANGUAGE_CD ,D.DESCR FROM PS_ITEM_SF A ,PS_ITEM_TYPE_TBL B ,PS_ITEM_TYPE_LNG D ,PS_BUS_UNIT_TBL_SF C WHERE A.BUSINESS_UNIT=C.BUSINESS_UNIT AND B.SETID=D.SETID AND B.ITEM_TYPE=D.ITEM_TYPE AND B.EFFDT=D.EFFDT AND A.ITEM_TYPE=B.ITEM_TYPE AND A.SA_ID_TYPE = 'O' AND B.SETID=( SELECT D.SETID FROM PS_SET_CNTRL_REC D WHERE D.RECNAME='ITEM_TYPE_TBL' AND D.SETCNTRLVALUE=C.INSTITUTION) AND B.EFFDT=( SELECT MAX(EFFDT) FROM PS_ITEM_TYPE_TBL Y WHERE Y.SETID=B.SETID AND Y.ITEM_TYPE=B.ITEM_TYPE AND Y.EFFDT <= %CurrentDateIn AND Y.EFF_STATUS = 'A' )
|