how do i not count weekend days in an access querry

V

vanderghast

You can subtract the number of Saturday and Sunday from the total number of
days between the two dates.

If starting and ending are not a Saturday, then

DateDiff("ww", starting, ending, vbSaturday)

returns the number of Saturday between the two dates.

Even if the limits are a Saturday, or a Sunday, the formula MAY work. As
example:

? DateDiff("d", "7 nov 2009", "14 nov 2009")- DateDiff("ww", "7 nov 2009",
"14 nov 2009", vbSaturday) - DateDiff("ww", "7 nov 2009", "14 nov 2009",
vbSunday)
5



If you also have to take count of other holidays, better to place these
local holidays in a table and use a DCOUNT on that table for dates between
your two limits. Be sure to not subtract the same date twice (an holiday
falling on a saturday, as example).



Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top