I'd like to select some dates in the format:
yyyydDOY
where yyyy
is the 4-digit year, DOY
is the day of year (1-366), and d
is a literal "d". Here's what I tried:
SQL> select to_char(sysdate, 'YYYYdDDD') from dual;
TO_CHAR(
--------
20130713
Obviously that's all wrong. The result I want can be found on the command line:
$ date +'%Yd%j'
2013d071