Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2009
    Posts
    11

    Unanswered: Week end date based on a start date from prior week

    I am trying to create a week end date based on a start date from prior week.

    Example: A date range of 07/24/2009 to 07/30/2009 would return a week ending date of 07/30/2009

    Thanks in advance!

    I was working with the following code:
    Code:
    : [ENTRYDATE]+7-Weekday([ENTRYDATE],7)
    This returns the Friday WE date. I would like to understane what the code is doing - this would be a great help!

  2. #2
    Join Date
    May 2009
    Posts
    258
    The Weekday function is figuring out what day of the week (1-7) the [ENTRYDATE] is. This is based on the second parm, the 7 here means the first day of the week is on Saturday. Since there are seven days in the week, it's adding the number of days left in the week to the current date to find the end of the week.

    If you want the week to end Thursday, you have to put a 6 in the Weekday function (so the first day of the week is Friday).

    Ax

  3. #3
    Join Date
    Aug 2009
    Posts
    11
    Thanks for the information.

  4. #4
    Join Date
    May 2009
    Posts
    258
    You're welcome!

Posting Permissions

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