date comparison
Hi Gurus,
I have a table T with a date column dt_col. I ran a sql to filter based on that column. But I have some doubts.
select dt_col from T where to_char(dt_col, 'MM/DD/YYYY') between '08/16/2010' and '08/20/2010';
This gives results from all over the table. i.e. the filter is not working. But
select dt_col from T where dt_col between to_date('08/16/2010' , 'MM/DD/YYYY') AND to_date('08/20/2010', 'MM/DD/YYYY');
this gives the correct results. I don't understand why the first query did not work. Please some one explain.
Thanks,