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!

How to compare Date & Time Separately in oracle

Sruthi TamiriMar 5 2019 — edited Mar 7 2019

Hi Team,

Our application is Legacy application they have created date & time columns as varchar2(50) instead of data type as date.

They is some reason beyond in that of creating as varchar2 so we can't change datatypes now.

1. Since Date & Time are in varchar2, data can exists as alpha numeric.

    Ex: 01-jan-2018, 02 Feb 2018, 03 UNK 2018, 04 UN 2018, 05 Jan 2018 10:00:00 and soon...

2. In Time column time can exists as

   Ex: 11:00, 10:00:N/A, 10:UNK:00 and soon.

How do we handle different kind of validations while comparing only dates separately and time separately.

Can i get a Query for handling such scenario's.

Regards,

Sruthitamiri.

Comments
Post Details
Added on Mar 5 2019
12 comments
591 views