UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Age Calc -- Returns the age in years and weeks for the supplied    
 
   
Candace Tripp
post May 31 2002, 08:10 AM
Post#1


UA Admin & Utter Angel
Posts: 3,039
Joined: 30-January 00
From: Virginia, USA


Function AgeCalc(datBirthDate As Date, intWeeks As Integer) As Integer
' Comments : returns the age in years and weeks for the supplied birthdate
' Parameters: datBirthDate - date to check
' Sets : intWeeks - set to the age in weeks
' Returns : integer number of years
'
If Day(datBirthDate) <= Day(Now) Then
intWeeks = DateDiff("w", datBirthDate, Now)
Else
intWeeks = DateDiff("w", datBirthDate, Now) - 1
End If

AgeCalc = Year(Now) - Year(datBirthDate) + (DateSerial(Year(Now), Month(datBirthDate), Day(datBirthDate)) > Now)

End Function
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    13th December 2017 - 02:04 AM