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!

How to add days to a DATE variable?

Stanley Lee-OracleNov 10 2011 — edited Nov 10 2011
Hi,

I want to run a query based on my date variable with subtracting 7 days from it. Thanks.

p_date DATE;

Select * from table where theDate between to_date(p_date , 'yyyy/mm/dd') to_date(p_date - 7, 'YYYY/mm/dd');

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 8 2011
Added on Nov 10 2011
2 comments
1,539 views