Function Dates Times Class

FirstDayOfWeek

Returns the first day of the week (the first Sunday) for the given date. Returns vDate if it is already the first day of the week.

Signature (Visual Basic / VBA)

Public Function FirstDayOfWeek( _
    ByVal vDate As Variant _
    ) As Variant

Code Example

    FirstDayOfWeek(#1/13/96#) = #1/7/96#
    FirstDayOfWeek(#1/14/96#) = #1/14/96#
    FirstDayOfWeek(#1/15/96#) = #1/14/96#
    FirstDayOfWeek(#1/20/96#) = #1/14/96#
    FirstDayOfWeek(#1/21/96#) = #1/21/96#

Parameters

Parameter Description
vDate The date used to determine the week whose first day is returned. Function returns Null if vDate is Null or cannot be fixed up to a Date.

Notes & Version History

v2.0 Addition This function is new to this version of Entisoft Tools.