The goal is to return the info from the latest assignment for each ‘eligibility’. If there are two assignments with the same date, still only return one row per ‘eligibility’ with the assignment picked being arbitrary.
Current method:
qCurrentAssignment_sub:
SELECT tblAssignment.EligibilityID, Max(DateAdd("s",[AssignmentID] Mod 10000,[AssignmentDate])) AS DatePlusIDMod10000
FROM tblAssignment
GROUP BY tblAssignment.EligibilityID;
qCurrentAssignment:
SELECT tblAssignment.AssignedTo, tblAssignment.AssignedBy, tblAssignment.Method, tblAssignment.AssignmentDate
FROM qCurrentAssignment_sub INNER JOIN tblAssignment ON
(qCurrentAssignment_sub.EligibilityID = tblAssignment.EligibilityID) AND
(qCurrentAssignment_sub.DatePlusIDMod10000 = DateAdd("s",[AssignmentID] Mod 10000,[AssignmentDate]));
Updated From Comment
If given
Change qCurrentAssignment_sub to
qCurrentAssignment_sub
Then join back to tblassignment on assignmentid. This makes the join a little cleaner as well
qCurrentAssignment