This article was previously published under Q210498
Moderate: Requires basic macro, coding, and interoperability skills.
Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.
View products that this article applies to.
Option Explicit
Function GetMonDate(CurrentDate)
If VarType(CurrentDate) <> 7 Then
GetMonDate = Null
Else
Select Case Weekday(CurrentDate)
Case 1 ' Sunday
GetMonDate = CurrentDate - 6
Case 2 ' Monday
GetMonDate = CurrentDate
Case 3 To 7 ' Tuesday..Saturday
GetMonDate = CurrentDate - Weekday(CurrentDate) + 2
End Select
End If
End Function
? GetMonDate(#4/30/93#)
#4/26/93#
Keywords: KB210498, kbprogramming, kbhowto