hi
i think your report is rather similar in nature to what i'm doing now
Mine is abt retrieving history for the past 6 months and past 1 year to determine the avg unit price for a part.
what i did was define a period parameter of numVar
After which i created a custom function called PastXMonths to determine the date range
Function (numberVar period)
Local dateVar Range dr;
select period
Case 6:
dr:=Date(DateAdd("m",-6,Date(Year(CurrentDate),Month(CurrentDate),1))) To CurrentDate
Case 12:
dr:=Date(DateAdd("m",-12,Date(Year(CurrentDate),Month(CurrentDate),1))) To CurrentDate
default:
dr:=Date(2004,01,01) To CurrentDate
And another parameter minDate to find the lower bound of the range...
well there might be more simpler way which i could not think of currently =b
hope this help. Gd luck!