Tell Access to ignore completely the weekends?

  • Thread starter Thread starter Henro
  • Start date Start date
H

Henro

How can I tell access to completely ignore the saturdays and sunday? I want
the dates to bre correct, otherwise Acess should act as if saturday and
sunday don't exist!

Any idea's?

Thanks in advance,

Henro
 
Henro said:
How can I tell access to completely ignore the saturdays and sunday?
I want the dates to bre correct, otherwise Acess should act as if
saturday and sunday don't exist!

You're going to have to give some context for this request. Obviously,
there's no option setting for "No Weekends"! But you can write VBA
functions to exclude weekends from, say, the count of days between two
dates -- that is, get a count of "business days" -- and to add some
number of "business days" to a date, and to determine whether a given
date is a weekend day or not. See the code posted at

http://www.mvps.org/access/datetime/date0012.htm

for how to distinguish work days in your Access application.
 
Have a look at the "Weekday" function in Access, you may not need to
write any code if you understand query writing.
 
It is exactly what you mention that I want: I want to calculate the number
of WORKING days from f.e. 16-7-2004 to 09-08-2004 to know how much
workingtime has been spent on a certain customer.
So, whereever I do a count of days between to moments, I want it to skip the
weekends.

Grtz Henro
 
Henro said:
It is exactly what you mention that I want: I want to calculate the
number of WORKING days from f.e. 16-7-2004 to 09-08-2004 to know how
much workingtime has been spent on a certain customer.
So, whereever I do a count of days between to moments, I want it to
skip the weekends.

Grtz Henro

The functions at the link I posted give you everything you need.
Specifically, the function dhCountWorkdaysA() counts the work dats
between two dates. Just copy and paste all the functions into a new
standard module and call them as in the examples given in the comments.
 
Back
Top