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
Rhonda CarrollAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
sdstuberConnect With a Mentor Commented:
select * from yourtable where invoice_date > add_months(sysdate,-12)

or

select * from yourtable where invoice_date > sysdate-365
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.