by MYLE
21. June 2010 21:39
some ask me need to know the age of someone to the Month ie 45.5 months don't know why but ....
Function Age(Birth_Date,End_Date)
'***************************************
' Works out the age of to the month
'
'***************************************
Dim Months
Dim Years
Dim Temp
If IsNull(Birth_Date) or Birth_Date ="" Then
Age=0.0
else
Months = DateDiff("m", CDate(Birth_Date), End_Date)
Years = Int(Months / 12)
Temp = Years * 12
If Years = 0 then Years = ""
Age = Years & "." & Months - Temp
End if
End Function
MyAge = age(DOB,now())
0d0a0270-b254-44e6-a4e1-43415727e692|0|.0
Category: ASP, MSaccess, VB
Tags: