• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 270
  • Last Modified:

How can I query records that are only within the last year using sysdate?

Hi There,

I have a field invoice_date that is a DATE field. I want to be able to select all rows from the table invoice  to show customers who have had an invoice within the last 12 months using sysdate. How can this be done?


Thassk,
R
0
Rhonda Carroll
Asked:
Rhonda Carroll
1 Solution
 
sdstuberCommented:
select * from yourtable where invoice_date > add_months(sysdate,-12)

or

select * from yourtable where invoice_date > sysdate-365
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now