Get date from week number

Results 1 to 2 of 2

Thread: Get date from week number

  1. #1
    Join Date
    Dec 1969

    Default Get date from week number

    Using...<BR>DatePart("ww", "4/25/2003", 2, vbFirstFourDays)<BR>I was able to find the week number of any given date.<BR><BR>Now HOW can I find any date by Week Number? (going reverse)<BR><BR>I am making a calendar which is based on weekly view. I need a week number to begin with and then I&#039;ll get the date and details.<BR><BR>Thank You.

  2. #2
    Join Date
    Dec 1969

    Default Depends on definition of week num

    But you could certainly do something like:<BR><BR>theDate = DateAdd( "ww", weekNumber-1, DateSerial(2003,1,1) )<BR><BR>That will get you to the right week but not the day that starts that week.<BR><BR>And what day starts that week depends on your definition of a week number. Unfortunately, you are using vbFirstFourDays when going the other way, so that&#039;s going to be fun to figure out backwards.<BR><BR>You might have to adjust based on which day of the week you get out of that DateAdd.<BR><BR>

Posting Permissions

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