Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Yearly query

Status
Not open for further replies.

mortac8

Programmer
Jun 7, 2001
12
US
I need help on making a query that will report from a date range of (the current date - 12 months) to (the current date). I need the previous 12 months worth of data reported whenever the report is run.

Any ideas? Thanks alot!
 
surely you can justbuild a pre defined condition doing a between on your calendar table using a systemdate (sysdate, getdate() ) etc depending what database you are reporting aginst.
 
Hi,
You can do it by first taking a sysdate and then checking the date in record wheather it is a year behind to sysdate or not. Populate only those records which are satisfying the condition. Sysdate you can select from any table by giving condition of rownum=1.

Hope this will help you,

With cheers,
Deepak Veni
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top