Results 1 to 3 of 3

Thread: Receiving a date from a week number?

  1. #1
    Guest
    Does somebody now what function or does someone have some code for receiving
    a Date when my input value is a week number?

    I will appreciate any help.

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    you can use the "dateAdd" function.

    Code:
    MsgBox DateAdd("WW", weekNumber, "01/01/2000")
    Iain, thats with an i by the way!

  3. #3
    Addicted Member
    Join Date
    Jul 2000
    Location
    Scotland
    Posts
    184
    Then offset Iain17's result to get the day you want. I think his returns a Saturday, ie End of Week).

    Code:
    Function FirstOfWeek(Optional dteDate As Date) As Date
        ' Assuming Sunday is first day of week.
    
        If CLng(dteDate) = 0 Then
            dteDate = Date
        End If
    
        FirstOfWeek = dteDate - Weekday(dteDate) + 1
    
    End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width