I always get confused with date format in ORACLE SQL query and spend minutes together to google, Can someone explain me the simplest way to tackle when we have different format of date in database table ?
for instance i have a date column as ES_DATE, holds data as 27-APR-12 11.52.48.294030000 AM of Data type TIMESTAMP(6) WITH LOCAL TIME ZONE.
I wrote simple select query to fetch data for that particular day and it returns me nothing. Can someone explain me ?
select * from table
where es_date=TO_DATE('27-APR-12','dd-MON-yy')
or
select * from table where es_date = '27-APR-12';