GetMonDate

By | 2002-06-01

Get the previous week’s Monday…”Kathleen A. Earley”

Original Author: Newsgroup Posting

Code

Function GetMonDate (CurrentDate)
  'checks to see if CurrentDate is a Date datatype
  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

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.