pardon me for jumping on this thread late.
There is nothing about regular database maintenance that can be done more easily than with code. Manually deleting records is a very bad idea and I would side with June that it's likely a mistake to do this. In any table where I may need to ignore records I have a 'void' yes/no field and I update that value to -1 (yes) if that record is no longer valid or to be reported on anything, then in all my queries I filter by <>-1 for that 'void' field. Once you delete your data it is gone forever and if you do need to go back to look at old training records you're screwed. I'll also say that the policy in my office dictates that we destroy records that are older than 30 days to 7 years depending on the context of the data *and* there are some we are required to keep permanently. But we maintain data in our databases far longer than that because we need a history and it does not affect physical storage or exposure of theft/destruction.
The way you have gone about finding the max value for each of your tables you're interested is the right step.
What I would do next is to add your employee table, then link it to each one of these tables so that you have a full record of every employee with a maxiumum date for each of your two tables (if they exist).
Example:
Code:
tblEmployees
EmpID EmpName
1 Mickey
2 Donald
3 Minnie
tblTraining
TrainID EmpID TrainingDate
1 1 1/1/2001
2 2 1/1/2011
tblPermit
PermID EmpID ExpirationDate
1 2 1/1/2002
2 3 1/1/2007
qryFindMaxTrngDate would return
EmpID MaxTrDate
1 1/1/2001
2 1/1/2011
qryFindMaxPermitDate would return
EmpID MaxPeDate
2 1/1/2002
3 1/1/2007
And the query I'm suggestiong would return
EmpID MaxTrDate MaxPeDate
1 1/1/2001
2 1/1/2011 1/1/2002
3 1/1/2007
From there it's pretty simple to cycle through the records and compare the dates side by. If you found that either/both of the dates were more than five years old you could then issue a mass update query command that would update all records in each of your tables for the EMPID of the person being examined.