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

Days Between Dates Function
Math Financial Class

Public Function DaysBetweenDates( _
      ByVal vFm As Variant _
    , ByVal vTo As Variant _
    , Optional ByVal vBasis As Variant _
    , Optional ByVal vExcelVersion As Variant _
    ) As Variant

Determine the number of days between two dates using the specified day count basis. Version of the Days360 function that supports all of the Day Count Basis constants.

Examples:
    DaysBetweenDates(#1/1/96, #2/15/96#, US_NASD_30_360) = 44
    DaysBetweenDates(#1/1/96, #2/15/96#, European_30_360) = 44
    DaysBetweenDates(#1/1/96, #3/15/96#) = 74
    DaysBetweenDates(#1/1/96, #3/15/96#) = 74
    DaysBetweenDates(#2/28/96, #5/31/96#) = 93
    DaysBetweenDates(#2/28/96, #5/31/96#, Eutopean_30_360) = 92
See also:
    Days360 Function
    CouponDaysBeforeSettlement Function
    CouponDaysAfterSettlement Function
    CouponDays Function
    DAYS360 Function (Microsoft Excel)
vFm: The beginning (first day) of the date interval. Function returns Null if vFm is Null or cannot be interpreted as a Date. The time component of vFm (if any) is ignored.
vTo: The end (last day) of the date interval. Function returns Null if vTo is Null or cannot be interpreted as a Date. The time component of vTo (if any) is ignored.
vBasis: Optional day count basis that determines how to count the difference in days and years. One of the following day count basis constants: US_NASD_30_360, Actual_Actual, Actual_360, Actual_365, or European_30_360. vBasis defaults to US_NASD_30_360 if it is missing or Null or cannot be interpreted as a number. Function returns Null if vBasis is not one of the recognized Day Count Basis constants.
vExcelVersion: Optional True or False value. This value only affects this function when vBasis is US_NASD_30_360. True if the function should return the exact same results as the Microsoft Excel DAYS360 function when vBasis is US_NASD_30_360, and False if it should use the Securities Industy Association definition of the 30/360 day count basis. vExcelVersion defaults to False (use the SIA definition for the US NASD 30/360 day count basis when vBasis is US_NASD_30_360) if it is missing or Null or cannot be interpreted as a Boolean value. See the Days360 function for details on how the vExcelVersion argument affects the result of this function.
v2.0 Addition: This function is new to this version of Entisoft Tools.

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