Sunday, June 28, 2015

Calculate Age

A few solutions



Here are some methods that have been posted to the newsgroups:

Assuming that the birth date field is called [BDate] and is of type date, you can use the following calculation:

Age:DateDiff("yyyy", [Bdate], Now())+ _
Int( Format(now(), "mmdd")

Alternately you can use this function to calculate age:

Function Age(Bdate, DateToday) As Integer
' Returns the Age in years between 2 dates
' Doesn't handle negative date ranges i.e. Bdate > DateToday

If Month(DateToday) < age =" Year(DateToday)" age =" Year(DateToday)">



From:
The Access Web (MVPs.org)

Also see:

Support.Microsoft.com:
Two Functions to Calculate Age in Months and Years

Office Tips:
Martin Green
Working out Someone's Age



See all Topics

No comments: