Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

trying to subtract days from a date

658699Aug 14 2009 — edited Aug 14 2009
Im trying to subtract days from a date.

When i use this query:

select sysdate-:p21_DAYS_OLD from dual;

it displays the correct date but not in the correct format. It is displaying 12-AUG-09 instead of 08/12/2009.


I tried this query but i get the ORA-01722: invalid number error.

select to_char(sysdate,'MM/DD/YYYY')-(:p21_DAYS_OLD) from dual;



Can someone help me please?
Deanna
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 11 2009
Added on Aug 14 2009
5 comments
2,894 views