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!

Ignore time component when comparing dates

flying_penguinNov 7 2008 — edited Nov 7 2008
DB version:10gR2

In one of our codes , the client wants the dates to be compared by ignoring the time component from the date.
ie they don't want MM:DD:YYYY HH:MI:SS, they just want MM:DD:YYYY,

So I am modifying
  when ship_date > est_date_del
  
  to

  when to_char(ship_date, 'YYYYMMDD')> to_char(est_date_del,'YYYYMMDD')
  
This is fine. Right? Will there be any issues relating to this comparision logic. You guys have any suggestions when comparing dates using to_char function?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 5 2008
Added on Nov 7 2008
14 comments
11,210 views