I am trying to use a date field in my query to sum hours after that date by using a "where" expression.
But then I get an Enter Parameter Value for qryTestingMostRecentTest.MaxOfTestDate.
How can I use that MaxOfTestDate to sum ClassHours that are reported on or after the MaxOfTestDate?
Code:
SELECT tblClassAssignment.StudentID, qryTestingMostRecentTest.StudentFileName, tblTesting.TestTypeID, Max(qryTestingMostRecentTest.TestDate) AS MaxOfTestDate, Sum(tblClassHours.ClassHours) AS SumOfClassHours
FROM ((qryTestingMostRecentTest INNER JOIN tblTesting ON qryTestingMostRecentTest.StudentID = tblTesting.StudentID) INNER JOIN tblClassAssignment ON tblTesting.StudentID = tblClassAssignment.StudentID) INNER JOIN tblClassHours ON tblClassAssignment.AssignmentID = tblClassHours.AssignmentID
WHERE (((tblClassHours.DateReported)>=([qryTestingMostRecentTest].[MaxOfTestDate])))
GROUP BY tblClassAssignment.StudentID, qryTestingMostRecentTest.StudentFileName, tblTesting.TestTypeID
ORDER BY qryTestingMostRecentTest.StudentFileName;
But then I get an Enter Parameter Value for qryTestingMostRecentTest.MaxOfTestDate.
How can I use that MaxOfTestDate to sum ClassHours that are reported on or after the MaxOfTestDate?