Currently I have a series of parameter queries that require the user to input the beginning and ending date range to calculate the 4,6,9,12 & Left-to-Go month forecasts, it is cumbersome and it leaves lots of room for human error to leave these queries as human input required. Does anyone know a formula that I could use instead? It would have to refer to the Fiscal year and period that is input into the beginning form as the starting point then it would have to eventually calculate the ranges in yyyypp format. I would need a formula that would calculate the range for 4 month period, 6 month period, 9 month period, 12 month period, & Left- to - Go period (= current period+1 till end of year). An example of my current query is below.
Code:
INSERT INTO [mtb-9mnth Dmd Fcst] ( [Import Year], [Import Period], [New League], [New Group], Style, [Color Code], [SumOfResultant Forecast], [AvgOfStandard Cost] )
SELECT [Demand fcst].[Import Year], [Demand fcst].[Import Period], [Demand fcst].[New League], [Demand fcst].[New Group], [Demand fcst].Style, [Demand fcst].[Color Code], Sum([Demand fcst].[Resultant Forecast]) AS [SumOfResultant Forecast], Avg([Demand fcst].[Standard Cost]) AS [AvgOfStandard Cost]
FROM [Demand fcst]
WHERE ((([Demand fcst].[Forecast Year Period]) Between [Enter Beginning YearPd for 9 mnth:] And [Enter Ending YearPd for 9 mnth:]))
GROUP BY [Demand fcst].[Import Year], [Demand fcst].[Import Period], [Demand fcst].[New League], [Demand fcst].[New Group], [Demand fcst].Style, [Demand fcst].[Color Code]
HAVING ((([Demand fcst].[Import Year])=[Forms]![frm-Year_Pd]![Year]) AND (([Demand fcst].[Import Period])=[Forms]![frm-Year_Pd]![Period]) AND (([Demand fcst].[New League]) Not In ("BLANKS","HARLEY")));

If these queries would be better written as VBA I'm not apposed to doing that, I just didn't know how to go about doing that.
Any help would be greatly appreciated
Thanks in advance Nena