To_date and to_char formats usually work both ways. But not for quarter (Q):
select to_char(sysdate,'q') from dual;
select to_date('2','q') from dual;
T
-
2
1 row selected.
select to_date('2','q') from dual
*
Error at line 1
ORA-01820: format code cannot appear in date input format
Any reason why to_date won't accept Q as format? I would expect it to return the first day of the quarter of the current year, just like using MM returns the first day of the month of the current year:
select to_date('2','mm') from dual;
TO_DATE('
---------
01-FEB-10
I tried it on 9.2.0.8 and 10.2.0.1 (XE).