Joe,
Thank you very much for your help. This was really a unique challenge for me. I did some slight modification to your advice. I ended up having to include the RefreshRate within the first query. Other than that it works perfectly. Here are the two queries that I used:
Code:
SELECT tblEmployees.Name, tblCourses.Course, tblCourses.RefreshRate, Max(tblEmployeeTrainingTracker.LastCompleted) AS MaxOfLastCompletedFROM (tblCourses INNER JOIN tblEmployeeTrainingTracker ON tblCourses.[ShipsID] = tblEmployeeTrainingTracker.[ShipsID]) INNER JOIN tblEmployees ON tblEmployeeTrainingTracker.[EmployeeID] = tblEmployees.[EmployeeID]
GROUP BY tblEmployees.Name, tblCourses.Course, tblCourses.RefreshRate
HAVING (((tblCourses.RefreshRate)<>'None'))
ORDER BY tblEmployees.Name, tblCourses.Course, tblCourses.RefreshRate, Max(tblEmployeeTrainingTracker.LastCompleted);
Code:
SELECT qryLatestTraining.Name, qryLatestTraining.Course, qryLatestTraining.MaxOfLastCompleted, Switch(qryLatestTraining.RefreshRate='Annual',DateAdd("yyyy",1,MaxOfLastCompleted),qryLatestTraining.RefreshRate='2 Year',DateAdd("yyyy",2,MaxOfLastCompleted),qryLatestTraining.RefreshRate='3 Year',DateAdd("yyyy",3,MaxOfLastCompleted),qryLatestTraining.RefreshRate='5 Year',DateAdd("yyyy",5,MaxOfLastCompleted)) AS CourseExpires
FROM qryLatestTraining;
This worked out perfectly. No errors.
Thank you for the mentoring once again.