Kirstie,
Try it like this...
=DateDiff("yyyy",[DOB],Date())+(Format([DOB],"mmdd")>Format(Date(),"mmd
d"))
I have this subroutine that I use in a VB application that will calculate
the exact age of someone in years, months and days (ie. 47 yrs, 8 months, 8
days). One of these days, I will convert it to VBA function, but since I
have not needed it yet, I haven't done this. Here is the code if anyone
wants to give it a try:
Public Sub actage()
Dim intBmonth As Integer, intCmonth As Integer
Dim intNumMonths As Integer, intNumYears As Integer
intNumMonths = DateDiff("m", intBdate, intDay)
intNumYears = DateDiff("yyyy", intBdate, intDay)
intBmonth = Month(intBdate) 'birth month
intCmonth = Month(intDay) 'current month
'calculate number of years
intNumYrs = intNumYears 'if birthdate is before current date
If intBmonth > intCmonth Then
intNumYrs = intNumYrs - 1 'havent reached the birthday yet
End If
If intBmonth = intCmonth And Day(intBdate) > Day(intDay) Then
intNumYrs = intNumYrs - 1 'havent reached birthday yet
End If
'calculate number of months
If (intBmonth = intCmonth) And (Day(intDay) < Day(intBdate)) Then
intNumMts = 11 'same month but not yet birthdate
Else
If (intBmonth = intCmonth) And (Day(intDay) >= Day(intBdate)) Then
intNumMts = 0 'same month but after birthdate
Else
If Day(intBdate) <= Day(intDay) Then
intNumMts = intNumMonths Mod 12 'different month but after
birthday
Else
intNumMts = intNumMonths Mod 12 - 1 'different month but before
birthday
End If
End If
End If
If Day(intDay) >= Day(intBdate) Then 'birthdate is before current date
intNumDys = Day(intDay) - Day(intBdate)
Else 'birthdate is after current date, get remaining days of month
' 30 days has sept, april june and november, all the rest have 31,
except february
Select Case intBmonth
Case 4, 6, 9, 11
intNumDys = 30 + Day(intDay) - Day(intBdate)
Case 1, 3, 5, 7, 8, 10, 12
intNumDys = 31 + Day(intDay) - Day(intBdate)
Case 2
intNumDys = 28 + Day(intDay) - Day(intBdate)
End Select
End If
End Sub
NOTE: any variable that is not specifically dimensioned in this routine has
been declared in as public variables in a module.
the results are returned to the following three variables:
intnumdys, intnummts, intnumyrs.
Good luck.
Steve