TR_ID_IPIH_VW

(SQL View)
Index Back

Treasury Investment Holding


SELECT CASE WHEN D.MATURITY_DT IS NULL THEN (%CurrentDateIn - D.SETTLEMENT_DT) ELSE (D.MATURITY_DT - D.SETTLEMENT_DT) END ,D.TRANSACT_CURRENCY ,D.TRANSACTION_AMT ,M.MTM_ACCTG_VALUE FROM PS_TRX_HEADER_TR H INNER JOIN PS_TRX_DETAIL_TR D ON H.BUSINESS_UNIT = D.BUSINESS_UNIT AND H.TREAS_HEADER_ID = D.TREAS_HEADER_ID LEFT JOIN PS_RSK_DEAL_MTM M ON H.BUSINESS_UNIT = M.BUSINESS_UNIT AND H.TREAS_HEADER_ID = M.TREAS_HEADER_ID WHERE D.MATURITY_DT >= %CurrentDateIn AND D.INSTRMNT_BASE_TYPE IN ('01') AND D.ASSET_LIABILITY = 'A' AND H.DEAL_STATUS='03' AND D.SETTLEMENT_DT <= %CurrentDateIn AND (M.AS_OF_DATE IN (( SELECT MAX(MTM.AS_OF_DATE) FROM PS_RSK_DEAL_MTM MTM WHERE H.BUSINESS_UNIT = MTM.BUSINESS_UNIT AND H.TREAS_HEADER_ID = MTM.TREAS_HEADER_ID AND MTM.AS_OF_DATE <= %CurrentDateIn)) OR M.AS_OF_DATE IS NULL) UNION SELECT %CurrentDateIn - D.SETTLEMENT_DT ,D.TRANSACT_CURRENCY ,D.TRANSACTION_AMT ,M.MTM_ACCTG_VALUE FROM PS_TRX_HEADER_TR H INNER JOIN PS_TRX_DETAIL_TR D ON H.BUSINESS_UNIT = D.BUSINESS_UNIT AND H.TREAS_HEADER_ID = D.TREAS_HEADER_ID LEFT JOIN PS_RSK_DEAL_MTM M ON H.BUSINESS_UNIT = M.BUSINESS_UNIT AND H.TREAS_HEADER_ID = M.TREAS_HEADER_ID WHERE D.INSTRMNT_BASE_TYPE IN ('09') AND D.ASSET_LIABILITY = 'A' AND H.DEAL_STATUS='03' AND D.SETTLEMENT_DT <= %CurrentDateIn AND (M.AS_OF_DATE IN (( SELECT MAX(MTM.AS_OF_DATE) FROM PS_RSK_DEAL_MTM MTM WHERE H.BUSINESS_UNIT = MTM.BUSINESS_UNIT AND H.TREAS_HEADER_ID = MTM.TREAS_HEADER_ID AND MTM.AS_OF_DATE <= %CurrentDateIn)) OR M.AS_OF_DATE IS NULL)

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 DAYS Number(6,0) INTEGER NOT NULL Days
2 CURRENCY_CD Character(3) VARCHAR2(3) NOT NULL Currency Code
3 AMOUNT Signed Number(28,3) DECIMAL(26,3) NOT NULL Amount
4 AMOUNT1 Signed Number(27,2) DECIMAL(25,2) NOT NULL Amount