To do this, the following 2 fields must be in your table of dependents:
Date of birth
Some way of indicating whether this person is or is not in school. This
could be a yes/no field.
Assuming that these two fields are named BirthDate and IsInSchool (of type
Yes/No), the query to select ineligibles would be:
SELECT * FROM tblDependents WHERE DateDiff("yyyy, BirthDate", Date()) >= 21
AND IsInSchool=0
To select eligible dependents:
SELECT * FROM tblDependents WHERE DateDiff("yyyy, BirthDate", Date()) < 21
OR IsInSchool<>0
--
Ted
|