Converting dates

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • OllyJ
    New Member
    • Dec 2007
    • 50

    #1

    Converting dates

    Hi guys

    I have a report which auto groups my daily results into weeks by week number:

    =Format$([OrderDate],"ww",0,0)

    ...Any ideas how I can introduce a column that would state 'Week Commencing Date' for each week???

    Thanks in advance, OllyJ
  • MikeTheBike
    Recognized Expert Contributor
    • Jun 2007
    • 640

    #2
    Originally posted by OllyJ
    Hi guys

    I have a report which auto groups my daily results into weeks by week number:

    =Format$([OrderDate],"ww",0,0)

    ...Any ideas how I can introduce a column that would state 'Week Commencing Date' for each week???

    Thanks in advance, OllyJ
    Hi

    Something like this
    Code:
    Dim YourDate As Date
        YourDate = Date
        
        MsgBox "Week Commencing Monday " & YourDate - (Weekday(YourDate, vbMonday) - 1)
    If you want week commencing on any other day just change vbMonday constant to suit.

    ??


    MTB
    Last edited by MikeTheBike; Apr 29 '08, 11:31 AM. Reason: It was wrong !!

    Comment

    Working...