SELECT A.BUSINESS_UNIT , A.CASHIER_OFFICE , A.RECEIPT_NBR ,C.LANGUAGE_CD , B.DESCR , C.DESCR , D.DESCRFORMAL ,E.XLATLONGNAME FROM PS_CSH_OFF_RECEIPT A , PS_BUS_UNIT_LNG B ,PS_BUS_UNIT_TBL_SF Y , PS_CSH_OFF_LNG C , PS_INSTITUTION_LNG D , PSXLATITEM E , PSOPTIONS F WHERE B.BUSINESS_UNIT = A.BUSINESS_UNIT AND C.BUSINESS_UNIT = A.BUSINESS_UNIT AND C.CASHIER_OFFICE = A.CASHIER_OFFICE AND D.INSTITUTION = Y.INSTITUTION AND B.BUSINESS_UNIT=Y.BUSINESS_UNIT AND D.EFFDT = ( SELECT MAX(D2.EFFDT) FROM PS_INSTITUTION_LNG D2 WHERE D2.INSTITUTION = D.INSTITUTION AND D2.EFFDT <= %CurrentDateIn ) AND E.FIELDNAME = 'SSF_APPR_STATUS' AND E.FIELDVALUE = A.SSF_APPR_STATUS AND E.EFFDT = ( SELECT MAX(E2.EFFDT) FROM PSXLATITEM E2 WHERE E2.FIELDNAME = E.FIELDNAME AND E2.FIELDVALUE = E.FIELDVALUE AND E2.EFFDT <= %CurrentDateIn )
|