• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

Previous Week's, Mondays Date Function

I need a simple function for returning the previous weeks, Monday's date?  Any help would be greatly appreciated!!!!
0
tbaseflug
Asked:
tbaseflug
  • 2
2 Solutions
 
davidrichardsonCommented:
0
 
tbaseflugAuthor Commented:
Thanks -

Tried the following, but get "12:00:00 AM" resturned in place of an actual date.

    Public Shared Function GetLastMondayDate() As Date

        DateAdd(DateInterval.Day, 1 - DatePart(DateInterval.Weekday, Date.Today, vbMonday), Date.Today)

    End Function
0
 
flavoCommented:
You forgot to return the value

    Public Shared Function GetLastMondayDate() As Date

        Return DateAdd(DateInterval.Day, 1 - DatePart(DateInterval.Weekday, Date.Today, vbMonday), Date.Today)

    End Function
0
 
flavoCommented:
Thanks!

Good luck with the rest of your project!

Dave
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now