I have a database with multiple records during each month.
Let's say in March, there is data for March 1, March 15, and March 22.
I need a query that can return the average student test scores for March, but also return only the average for the scores on March 22.
Is there a way to combine the functions:
Month([Date of Data Export])=3
along with something that returns the LAST date within the month of March?
Here's what I have so far:
This returns the averages for March, but gives me all dates within March.
Thank you for your help!
Let's say in March, there is data for March 1, March 15, and March 22.
I need a query that can return the average student test scores for March, but also return only the average for the scores on March 22.
Is there a way to combine the functions:
Month([Date of Data Export])=3
along with something that returns the LAST date within the month of March?
Here's what I have so far:
Code:
SELECT Last(TT_TestData.[Date of Data Export]) AS [LastOfDate of Data Export],
TT_TestData.[Class ID],
Avg(TT_TestData.Average) AS AvgOfAverage,
TT_TestData.[Test Form],
TT_TestData.[School Year],
TT_TestData.[School Name]
FROM TT_StudentData RIGHT JOIN TT_TestData
ON TT_StudentData.SSID = TT_TestData.SSID
GROUP BY TT_TestData.[Class ID],
TT_TestData.[Test Form],
TT_TestData.[School Year],
TT_TestData.[School Name],
TT_TestData.[Date of Data Export]
HAVING (((TT_TestData.[Class ID])="182")
AND ((TT_TestData.[Test Form])="B")
AND ((TT_TestData.[School Year])=[Forms]![F_Start_SchoolSelection]![SchoolYearCOMBO])
AND ((TT_TestData.[School Name])=[Forms]![F_Switchboard]![SchoolNameTextBox])
AND ((Month([Date of Data Export]))=3));
Thank you for your help!
Comment