Hi Helpful Forum Members,
I've got some code that gives a Date Range from Midnite the day before yesterday to Midnite yesterday.
Where timestamp_field between to_timestamp('19-11-2017 13:00:00', 'DD-MM-YYYY HH-MM-SS.ff') + interval hour + 11 and to_timestamp('20-11-2017 12:59:59', 'DD-MM-YYYY HH-MM-SS.ff') + interval hour + 11
I want to automate this so it always give the Data for the same period, The day before yesterday at Midnite to Midnite yesterday.
I've tried replacing the Date part '19-11-2017' with sysdate so I can use sysdate-1 for yesterday & sysdate-2 for the day before yesterday.
Where timestamp_field between to_timestamp(sysdate-2 '13:00:00', 'DD-MM-YYYY HH-MM-SS.ff') + interval hour + 11 and to_timestamp(sysdate-1 '12:59:59', 'DD-MM-YYYY HH-MM-SS.ff') + interval hour + 11
Can anyone help me here with the correct syntax?
Thanks