Como calcular a idade em anos entre duas datas?

Compartilhe esta Faq!

Como calcular a idade em anos entre duas datas?

Public Function Age(Bdate As Date, DateToday _
As Date) As Integer
If Month(DateToday) < Month(Bdate) Or _
(Month(DateToday) = Month(Bdate) And _
Day(DateToday)<Day(Bdate)) Then
Age = Year(DateToday) - Year(Bdate) - 1
Else
Age = Year(DateToday) - Year(Bdate)
End If
End Function



Faqs relacionadas