Format-based Oracle datetime comparison

In Oracle, how to make this date, compare if the column type is date and time? I want to save the string format "MM / dd / yyyy".

how to do it?

thanks

select * from my_tbl where mycol >= '07/11/2012' 
+4
source share
1 answer

Assuming this date means July 11th:

 select * from my_tbl where mycol >= to_date('07/11/2012', 'MM/DD/YYYY'); 

If this date should be November 7th:

 select * from my_tbl where mycol >= to_date('07/11/2012', 'DD/MM/YYYY'); 

Depending on how you fill in the values ​​for mycol, you can also get rid of the temporary part:

 select * from my_tbl where trunc(mycol) >= to_date('07/11/2012', 'DD/MM/YYYY'); 
+7
source

All Articles