Logo
Home Cart [Log In] About Us Contact Us

Object Reference

xf_GeneralGeneral Functions

Public Function GetAge (
vDOB As Variant,
Optional AsAtDate As Date = 0
) As Variant

Get age as specified date given date of birth.
This is not as easy as it might seem: DateDiff("y", DOB, Date) does not work Returns Null if the DOB cannot be converted to a valid date.

vDOB as Variant

Either Null or the Date of Birth as a Date or String.

Optional AsAtDate as Date = 0

The optional date at which to calculate age. Defaults to today.

Call Template:

Dim v As Variant
v = xf.Gen.GetAge(vDOB)
v = xf.Gen.GetAge(vDOB, AsAtDate)

See Also:

Example 1:

GetAge ("21 Sep 1970", #1 Jan 2014#) => 44
Contact Us :: About Us :: Policies :: email: infspamo@arrospamw-of-tispamme.com    © 2012 Arrow Of Time Pty Ltd