query giving different results
While executing the following query the execution time is more since the to_date funtion used in where condition.
select admission_date from iptran where to_date(admission_date) between to_date('26-10-2002','dd-mm-yyyy').
select admission_date from iptran where admission_date between to_date('26-10-2002','dd-mm-yyyy');
Results in no rows.
HOw should I re-write this query to retrieve in a minimum of time ?
Thanks in advance
that cant be the whole query huh
plus admission_date is date or varchar2, seems varchar2 to me, if that was the case how can you compare varchar2 to date doh
implicit conversion from varchar2 -> date ?
If so, it's most likely another date format is used then 'dd-mm-yyyy', which gives you other results.
Always use explicit conversion.
Click Here to Expand Forum to Full Width