Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Problem comparing dates
I amtrying to select rows that fit a certain time period.
My table:
BCV_START DATE
COL1 VARCAHR2 COL2 VARCAHR2
My data is inserted as follows:
INSERT INTO MYTABLE VALUES ( to_date('2005-07-20 16:30:00', 'YYYY-MM-DD HH24:MI:SS', 'data', 'data')
The following query is not behaving as expected:
SELECT * FROM MYTABLE where to_date(bcv_start, 'DD-MON-YYYY HH24:MI') > to_date('20-JUL-2005 01:00', 'DD-MON-YYYY HH24:MI') AND to_date(bcv_start, 'DD-MON-YYYY HH24:MI') < to_date('20-JUL-2005 17:00', 'DD-MON-YYYY HH24:MI') What am I doing wrong here?
Thx,
CC
Received on Thu Jul 21 2005 - 15:04:18 CDT