Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

to_date function

oracleNov 22 2005 — edited Nov 22 2005
Currently I am given the job to customize my previous colleagues work on PL/SQL.
The WHERE clause of a SQL statement to compare two DATE fields in the format of DD/MM/YYYY HH24:MI:SS is written as:
"WHERE to_date(to_char(rental_charge_date,'DD/MM/YYYY'),'DD/MM/YYYY') <= to_date(to_char(RUN_DATE,'DD/MM/YYYY'),'DD/MM/YYYY')".

My question is aint it enough to write the statement as
"WHERE to_char(rental_charge_date,'DD/MM/YYYY') <= to_char(RUN_DATE,'DD/MM/YYYY')".

Also the same kind of WHERE clause is used for around 8 times in different places. If I change it to my suggestion will it improve the performance or it will give only code enhancement.

Regards
Dinesh
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 20 2005
Added on Nov 22 2005
6 comments
418 views