|
Re: What is Problem with DAte Query [message #303606 is a reply to message #303604] |
Sat, 01 March 2008 01:28 |
|
Michel Cadot
Messages: 68716 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
ORA-01843: not a valid month
Mixing strings and numbers is a bad idea, you don't know how conversions are made.
If you remove the final TO_DATE you see the problem:
SQL> select TO_CHAR(SYSDATE, 'DDMM')||TO_NUMBER(TO_CHAR(SYSDATE, 'YYYY'))-5 from dual;
1032003
In addition, if you want to substract 5 years, have a look at ADD_MONTHS function.
Regards
Michel
[Updated on: Sat, 01 March 2008 01:32] Report message to a moderator
|
|
|