I need to retrieve record from the Oracle database by comparing with a time range? The column "OTime" is of Date datatype. I'm using ASP.
This is my SQL:
"SELECT * FROM Purchase WHERE (OTime BETWEEN to_date('" & from_time & "', 'HH24:MI:SS') AND to_date('"& to_time &"', 'HH24:MI:SS'))
There are no errors, but no records were retrieved. I have only stored the time into "OTime". Do I need to store the date as well?