I am using access as my DB to try to Sum the number of test attempts by subject for each Student for a SchoolGrade. Some basic info: A SchoolGrade has many students, a students test attempts are record by subject. I am wanting to update the total test attempts taken by subject for each SchoolGrade. Below is my query:
UPDATE [SchoolGrade] AS SG
INNER JOIN [Student] AS S ON S.schoolgrade_id = SG.id
SET SG.[Total Reading Test Attempts] = SUM(S.[Reading Test Attempts] ),
SG.[Total Math Test Attempts] = SUM(S.[Math Test Attempts] ),
SG.[Total Science Test Attempts] = SUM(S.[ScienceTest Attempts] );
I am getting the following error:
You tried to execute a query that does not include the specified expression 'Total Reading Test Attempts' as part of an aggregate function.
How do I fix this error?