How to compare a Timestamp returned from
Java code 2004-06-11 00:00:01.0
in a query in Oracle to a date value 2004-06-11 00:00:00.0 in the table .
I have used
select id
from table
where TIME between to_date('2004-06-09 00:00:00','yyyy-mm-dd hh:mi:ss') and to_date('2004-06-11 00:00:00','yyyy-mm-dd hh:mi:ss')
I get a message that hour can be between 1 and 12. But I want to check the time for midnight. How to format the date in SQL query...???