Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Location
    US
    Posts
    343

    Question Unanswered: How to get date for the start of a week

    If I have any date, is there a way to find out the date of start of the week and end of the week. Week starts from Sunday and ends on Saturday.

    Thanks in Advance.

  2. #2
    Join Date
    Oct 2003
    Location
    US
    Posts
    343
    Never mind I got it. Posting it ehre just in case someone else wants to know too.

    e.g. for a date 8/16/2004

    date for start of week is
    dateadd("d",(Cint(Format(#8/18/2004#,"w"))-1)*-1,#8/18/2004#)

    date for end of week is
    dateadd("d",7-Cint(Format(#8/18/2004#,"w")),#8/18/2004#)

    assuming that Sunday is the start of week.

  3. #3
    Join Date
    Apr 2004
    Location
    Sydney Australia
    Posts
    369
    I just added that to my collection and replaced #8/18/2004# with [FieldName] and worked like a charm.

    Mike

  4. #4
    Join Date
    Oct 2003
    Location
    US
    Posts
    343
    It always feel great to help someone...have fun..

    Quote Originally Posted by Mike375
    I just added that to my collection and replaced #8/18/2004# with [FieldName] and worked like a charm.

    Mike

Posting Permissions

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