Convert number to date sql oracle

Dev_dev picture Dev_dev · Jul 14, 2015 · Viewed 53.1k times · Source

I'm trying to convert a number (yyyymmdd) to date (mm/dd/yyyy)

For example

20150302 ====> 03/02/2015

Answer

Stefan Yordanov picture Stefan Yordanov · Jul 14, 2015

You can try this:

select to_date(20150302,'yyyymmdd') from dual;

or

select to_char(to_date(20150302,'yyyymmdd'),'mm/dd/yyyy') from dual;