Tools Links Login

GetMonDate

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

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 82 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Comments

No comments have been added for this post.

You must be logged in to make a comment.