I'm trying to convert a number (yyyymmdd
) to date (mm/dd/yyyy
)
For example
20150302 ====> 03/02/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;
The above answer is still incorrect. It returns a character string when a date is needed. The correct way is:
select to_date(to_char(20210416), 'YYYYMMDD') num_to_char_to_date from dual;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With