Get current week

Results 1 to 3 of 3

Thread: Get current week

  1. #1
    Alex T. Guest

    Default Get current week

    Hi. I have figured out to get the current week of the year (i.e. 1, 2, 3, etc.). However, I was wondering if anyone could tell me how to get a range for the current week. In other words, this week would be 5/20/01 - 5/26/01. My weeks always start on Sunday. Thanks in advance!

  2. #2
    Join Date
    Dec 1969

    Default RE: Get current week

    &#060;%<BR>today = Date()<BR>sunday = DateAdd( "d", 1-Weekday(today), today )<BR>saturday = DateAdd( "d", 6, sunday )<BR>%&#062;<BR><BR>For example, today is Tuesday, so Weekday(today) is 3. 1 - 3 is -2, so the first DateAdd says "go back 2 days from today". To Sunday, of course. And I hope the next DateAdd is obvious.<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default If you care...

    ...these same functions can be used inside Access&#039;s version of SQL, so you can easily build a query that gets records for the current week without doing any VBS-side manipulations.<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