Based on the date_entered column, which is a data_type of 'DATE' how would I parse out the data to pull the time.
Values in the DATE_ENTERED
field (DATA_TYPE
is DATE
) looks like this 5/15/2015 8:43:04 PM
I need to run queries based on when DATE_ENTERED
is between 05/15/2015 8:00 AM
and 05/15/2015 10:00 AM
I then need to incorporate that into a PL/SQL script that will run every 2 hours with the last two hours as the filter. My best explanation of this would be where it grabs the current date and time, and pulls 2 hours back, every 2 hours. This will allow it to run at 8am, 10am, 12pm, 2pm etc and have the last 2 hours of new entries in the query. For instance 10am run time will include results for items entered in from 8:00am until 10:00am
SYSDATE()
.SYSDATE
? Would it be something along the lines ofdateadd(-2, hh,SYSDATE())
? How would I do that in Oracle though?