Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Posts
    115

    Unanswered: Exclude weekend days

    This returns numbers of weeks.
    CountOfdays: DateDiff("w",[my_date],Now())

    I want to exclude weekend days

    How do I exclude just Saturday and Sunday?

    Thanks

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by Tommiller View Post
    This returns numbers of weeks.
    CountOfdays: DateDiff("w",[my_date],Now())

    I want to exclude weekend days

    How do I exclude just Saturday and Sunday?

    Thanks
    exclude weekdays.. what do you mean by that?
    by definition Saturday and Sunday are part of a week.

    ...if you mean you need to count weekends as the next week then you need to adjust the firstdayofthe week parameter
    MS Access: DateDiff Function
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jan 2004
    Posts
    115
    I want to count how many days this order is open, however I want to exclude (WEEKENDS) Saturday and Sunday.

    Thanks

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so find the number of days difference (use datediff but fidn the number of days not weeks)
    so you need to know the start day and the end day (use the weekday function)
    divide by \ 7 (\ uses integer maths) to find the number of whole weeks (multiply that by two to exclude weekend days)
    then you need to find if the part week straddles a weekend, use the weekday function again
    sunday is 1, monday is 2... saturday is 7
    ...
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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