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 get date values from a VARCHAR2 column.

Ram_ASep 7 2021

Hi Experts
We have the following values in VARCHAR2(30) column.
default date
02-12-2019
10-06-2020
begin Date
end Date
15-05-2021
18/03/2020
I want to extract only DATE values.
I am posting DDL and insert statements.
CREATE table customer(custid NUMBER,joindate VARCHAR2(30));
INSERT INTO customer VALUES(1001,'default date');
INSERT INTO customer VALUES(1002,'02-12-2019');
INSERT INTO customer VALUES(1003,'10-06-2020');
INSERT INTO customer VALUES(1004,'begin Date');
INSERT INTO customer VALUES(1005,'end Date');
INSERT INTO customer VALUES(1006,'15-05-2021');
INSERT INTO customer VALUES(1007,'18/03/2020');

Expected O/P
custid joindate
1002 02-12-2019
1003 10-06-2020
1006 15-05-2021
1007 18/03/2020

Please help me.

Thanks in advance.

Comments
Post Details
Added on Sep 7 2021
14 comments
625 views