<-- Previous || Up || Next -->

Age Difference Function
Dates Times Class

Public Function AgeDifference( _
      ByVal vFromDate As Variant _
    , ByVal vToDate As Variant _
    , Optional ByVal vCountTime As Variant _
    ) As Variant

Return the difference in years between the two dates.
vCountTime determines whether Time is considered within the calculation.

Top20: This function is among our "top-twenty" most useful.
Examples:
    AgeDifference(#1/1/70#, #1/1/96#) = 26
    AgeDifference(#1/1/70#, #5/1/96#) = 26
    AgeDifference(#9/1/70#, #5/1/96#) = 25
    AgeDifference(#1/1/70 9:00#, #1/1/96 5:00#) = 26
    AgeDifference(#1/1/70 9:00#, #1/1/96 5:00#, True) = 25
See also:
    AddBusinessDays Function
vFromDate: The earlier of the two dates for which the difference in years will be calculated. Function returns Null if vFromDate is Null or cannot be fixed up to a Date.
vToDate: The later of the two dates for which the difference in years will be calculated. Function returns Null if vFromDate is Null or cannot be fixed up to a Date.
vCountTime: True if the calculation should take into account the time components of vFromDate and vToDate, or False if it should examine only their date components. vCountTime defaults to False (only the date components will be used) if it is missing or Null or cannot be fixed up to a number.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.