اتفضل الحل
اولا لحساب العمر وفترة العمل فى دالة واحده
اتفضل هذا المديول
Function CalcAge(StartDate As Date, EndDate As Date) As String
Dim years As Integer
Dim months As Integer
Dim days As Integer
Dim intH As Integer
intH = Int(DateDiff("m", StartDate, EndDate)) + _
(EndDate < DateSerial(Year(EndDate), Month(EndDate), Day(StartDate)))
years = Int(intH / 12)
months = intH Mod 12
days = DateDiff("d", DateAdd("m", intH, StartDate), EndDate)
CalcAge = years & " سنة و " & months & " شهر و " & days & " يوم"
End Function
وهذا الاستعلام شامل كل شئ
SELECT tbl_info_fonctionnaire.num, tbl_info_fonctionnaire.nom_arabe, tbl_info_fonctionnaire.prenom_arabe, tbl_info_fonctionnaire.date_naissance, tbl_info_fonctionnaire.date_premiere_grade_poste, tbl_info_fonctionnaire.date_grade_poste_actuel, CalcAge([date_naissance],Date()) AS CalculateAge, CalcAge([date_premiere_grade_poste],Date()) AS WorkAge, DateAdd("yyyy",60,[date_naissance]) AS After60Y, DateAdd("m",18,[date_premiere_grade_poste]) AS After18M
FROM tbl_info_fonctionnaire;
النتيجة
المرفق
BASEF.rar