hope this helps
To display and group records from the current and previous quarter, complete the following steps:
1) On the 'Insert' menu, click 'Parameter'. Create two numeric parameter and name them 'Quarter' and 'Year'.
2) On the 'Report' menu, click 'Edit Selection Formula', then 'Record'.
In the 'Record Selection Formula Editor', enter the following text:
numbervar q:= tonumber({?Quarter});
numbervar y:= tonumber({?Year});
if {?Quarter} = "1"
then date(y-1,10,01) <= {Table. date field}
and date(y, 03, 31) >= {Table. date field}
else if {?Quarter} = "2" then {Table. date field} in date(y, 01, 01) to date(y, 06, 30)
else if {?Quarter} = "3" then {Table. date field} in date(y, 04, 01) to date(y, 09, 30)
else if {?Quarter} = "4" then {Table. date field} in date(y, 07, 01) to date(y, 12, 31)
// Replace {Table. date field} with your own date field.
3) On the 'Insert' menu, click 'Group'. Select your date field and set the grouping 'for each quarter'.
4) When you run the report, enter a single digit value for the 'Quarter' parameter and a four digit value for the 'Year' parameter.
If you are using CR 8 or higher, you can write a formula similar to the following. The advantage of this formula is that it allows processing to occur on the server rather than the client machine. This speeds processing of the report.
//The DateAdd function allows this
//formula to process on the server.
{Table. date field} >= Date(DateAdd("q", ToNumber({?Quarter})-2, Date(ToNumber({?Year}),01,01)))
and
{Table. date field} < Date(DateAdd("q", ToNumber({?Quarter}), Date(ToNumber({?Year}),01,01)))