Dagz200
Dagz200

Reputation: 211

crystal report parameter to look at last quarter

I need to have a date parameter to then have a formula to pull 4th quarter from previous year and first 3 qtrs of the current year. I know for the 4th qtr I would need to do that as a sub-report since i need to pull the last record for that qtr. How would I be able to do this.

Any help is greatly appreciated.

Upvotes: 0

Views: 1248

Answers (1)

Ryan
Ryan

Reputation: 7287

You don't need a subreport to do this. You can get the date range you're after with something like this. (Note that the use of variables is unnecessary and is only to illustrate the logic. You can omit them from the record selection formula.)

local datevar DateBegin := date(year(currentdate)-1,10,01); //Oct. 1 of last year
local datevar DateEnd := date(year(currentdate),09,30); //Sep. 30 of current year

{Date.Field} in DateBegin to DateEnd

Upvotes: 1

Related Questions