I have a chart on a report which I would like to report a rolling average of some First Pass Yield data. This works fine but I am getting more data than I want and wish to limit the data in the chart to 12 months from the most current month and the previous 11 months.
The SPL code for my chart is as follows:
in the actual query that I am pulling the data from the tables with I am limiting the time frame of the data to an end date provided from a field on a form but I am accepting any dates up until that date with the following criteria in the date field of my query:
How might I limit the starting date ranges to be within 12 months of my end date by changing either the criteria in my query or the SQL code for the chart?
The SPL code for my chart is as follows:
SELECT (Format([Date],"mmm"" '""yy")) AS Expr1, (Sum([Pass Quantity])/(Sum([Pass Quantity])+Sum([Fail Quantity]))*100) AS [FPY by Operation]
FROM [Rolling FPY qry]
GROUP BY (Format([Date],"mmm"" '""yy")), (Year([Date])*12+Month([Date])-1)
ORDER BY (Year([Date])*12+Month([Date])-1);
in the actual query that I am pulling the data from the tables with I am limiting the time frame of the data to an end date provided from a field on a form but I am accepting any dates up until that date with the following criteria in the date field of my query:
<=[forms]![print or view reports]![EndDate]
How might I limit the starting date ranges to be within 12 months of my end date by changing either the criteria in my query or the SQL code for the chart?