I'm using oracle 11g sql developer
I have a varchar2 column with dates as 0523 (mmDD).
I want to convert them to a date column and have them look like 23-05 (dd-mm)..
Any ideas?
I'm using oracle 11g sql developer
I have a varchar2 column with dates as 0523 (mmDD).
I want to convert them to a date column and have them look like 23-05 (dd-mm)..
Any ideas?
Well, you can do string operations directly to get the format you want:
substring(c, 3, 2)||'-'||substring(c, 1, 2)
To convert to a date, you can use:
to_date('2012'||c, 'YYYYMMDD')
To convert a date back to the form you want:
to_char(<date>, 'DD-MM')