> Check the DateAdd() function.
> To archive, create an append query and then delete records from your main
[quoted text clipped - 6 lines]
> > Then I need to archive everything older than 2 years. Any help would be
> > greatly appreciated. Thanks in advance.
From your initial post, I'm assuming you mean "current year" to be everything
from the employee's last anniversary date til now, and the "previous year" to
be everything between the last anniv. date and the previous anniv. date. Here
is a suggestion for the query to retrieve all training data for the
employee's current and previous years.
CAUTION: Untested Air Code!
SELECT * FROM TrainingHistory
WHERE TrainingDate >= IIF(DatePart("y",[ HireDate)] < DatePart("y", Date()),
DateSerial(Year(Date()-1), Month([HireDate[), Day([HireDate])),
DateSerial(Year(Date()-2), Month([HireDate]), Day([HireDate])))
What this does: The DatePart comparison tests if this year's anniv. date is
in the past or future. If past, the time window extends from last year's
anniv date to now. If future, the time window extends from the anniv date 2
years ago til now.

Signature
Ted
Richard - 09 Oct 2006 20:11 GMT
Thanks Ted!
> From your initial post, I'm assuming you mean "current year" to be everything
> from the employee's last anniversary date til now, and the "previous year" to
[quoted text clipped - 12 lines]
> anniv date to now. If future, the time window extends from the anniv date 2
> years ago til now.