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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rolling month

Status
Not open for further replies.

SusanL316

MIS
Oct 22, 2009
1
US
I need to write a report based on GP table RM00104 (Customer Period Summary). The month and year are in separate fields.

I will have 1 column for 12 months rolling back from October 2009 to November 2008.

I don't want to have to hard code the month and day in each formula (column).

Any suggestions for a formula that will allow for rolling month/year?
 
First, assemble the month and year as a date, something like
Code:
Datetime({your.year}, {your.month}, 1)
Then something like
Code:
DateDiff("m", @yourDate, currentdate)
That should give the number of months in the past. Try first displaying it with the raw data, then use it to group. Or to exclude records that are too old, using the selection rules.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top