VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



GetMonDate

by Newsgroup Posting (15 Submissions)
Category: Math/Dates
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (38 Votes)

Get the previous week's Monday..."Kathleen A. Earley"

Rate GetMonDate

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

Download this snippet    Add to My Saved Code

GetMonDate Comments

No comments have been posted about GetMonDate. Why not be the first to post a comment about GetMonDate.

Post your comment

Subject:
Message:
0/1000 characters