1. Registered User
Join Date
Jan 2004
Posts
115

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

Join Date
Nov 2004
Location
out on a limb
Posts
13,692
Originally Posted by Tommiller
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

3. Registered User
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

Join Date
Nov 2004
Location
out on a limb
Posts
13,692
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
...

#### Posting Permissions

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