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!

rooling time period in reportnet 1

Status
Not open for further replies.

slaforce

Programmer
Jul 29, 2002
77
US
I have a report that I need to run for a rolling 14 month time period (starting with the previous month). So if I run the report today - it should run for all dates from August 2003 to October 2004. Is there a calculation or a filter for this.

This is using reportnet
Thanks for the help.
 
You could do a calculation like:

IF
( date BETWEEN add_month( Mydate, -15) AND add_month(Mydate, -1) )
then ( Quantity)
else ( Null )

Make sure that you have the full month.
Mydate could be = Last_of_month( add_month(sysdate,-1))

I noticed that add_month( sysdate, -15 ) doesn't work in reportnet , it shoud be add_month(sysdate, 0-14 ) somehow reportnet generates an error if you simply but a minus figure.
 
Thanks Draoued. I need to show the values for each month on the report. This will just give me a summarized figure for the last fourteen months right?
 
yes right a summarize figure.

Then create a calculated field for each month.

month-14
IF
( date BETWEEN add_month( Mydate, -15) AND add_month(Mydate, -14) )
then ( Quantity)
else ( Null )

Month-13
IF
( date BETWEEN add_month( Mydate, -14) AND add_month(Mydate, -13) )
then ( Quantity)
else ( Null )

and so on....


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top