Hi I would really appreciate some help. I would like to declare 2 variables as dates in the date format as date1 = 31-AUG-15 and date2 = 01-SEP-15 and use that within the SELECT statement so I don't need to keep typing in dates everywhere when I need to change the date. Is this possible?
SELECT TABLE1.TRANSACTION_ID, TABLE1.AMOUNT, TABLE1.MATURITY, TABLE1.TYPE,
TABLE1.EFFECTIVE_DATE, TABLE1.SETTLEMENT_DATE, TABLE2.TRANSACTION_DATE
FROM TABLE1
LEFT JOIN TABLE2 ON TABLE1.TRANSACTION_ID = TABLE2.TRANSACTION_ID AND TABLE2.TRANSACTION_DATE = date2
WHERE TABLE1.MATURITY > date1
AND TABLE1.EFFECTIVE_DATE > date1
AND TABLE1.SETTLEMENT_DATE = date1