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!

5 separate 12 month periods from current date

Status
Not open for further replies.

fancyface

IS-IT--Management
May 17, 2006
104
CA
Hi there. I'm using Crystal 7 - limited I know. I need the amounts from last 12 months from the current date. No problem. Then previous to that I need the PREVIOUS 12 months. And previous to that I need the previous 12 months.

any ideas?
 
Since I have not used Crystal 7, I am not sure if you have the DateSerial function, which is what I used with Crystal 8.5 to go back 60 months
 
I don't necessarily want to go back 60 months. I want to go back the last 12 months. If that is 0 then get the 12 months only prior to that - not the last 24 months. And so on. I want each 12 month period for the last 5 years.
 
I think I understand what you want. However, what will you be displaying other than the amount?

With Crystal, a single record selection is performed. So you will have to grab all 60 months. Create formulas for each period and suppress them. If the amoount is 0, then unsuppress the previous period and so on.

The other alternative is to use subreports for each of the 12 months and global variable to monitor the value. This will allow you to incrementally execute and select 12 months at a time depending of the the value assigned from the previous amount.

 
Hi there. I don't see the dateserial function unfortunatley.
 
Without the DateSerial, it just means that the formula will just be a little more complex. How about LastFullMonth or DateAdd? Do you have that?

By the way, I am assuming a rolling 12-month period. If currentdate is 15-OCT-2008, DateAdd("m",-12,currentdate) will give you 15-OCT-2007.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top