var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Date conversion?
i'd say this is probably pretty basic.... but here goes.
i just want to convert some dates from 'YY-MM-DD' to 'YYYYDDD'
but using the following line i get an error saying that it's an invalid number format model
to_char(to_number(date, 'YY-MM-DD'), 'YYYYDDD')
Re: Date conversion?
which date-type is your 'date' ??
if it's DATE just use to_char(date, 'YYYYDDD')
if it's some kind of string use
to_char( to_date(date, 'YY-MM-DD'), 'YYYYDDD')
to_char needs a value of type DATE as 1st parameter.
no the initial variable is a char (eg. '03-07-30') and i assume that it should be converted to a date and then converted back to a char (format 'YYYYDDD').
but the following command returns an error: ORA-01481: invalid number format model
select to_char(to_number('03-07-30', 'YY-MM-DD'), 'YYYYDDD') from dual;
if you want to convert the string '03-07-30' to the string '2003211' (both as string-representation of a date)
don't convert to_number but to_date:
SQL> select to_char(to_date('03-07-30', 'YY-MM-DD'), 'YYYYDDD') from dual;
dohhhh! thanks for your help, what a silly mistake!