Counting Weekdays in the Future

L

LA Lawyer

I want to use Access 2007 VBA add a certain number of weekdays to Now().

I have found very nice sample codes which allow me to determine the number
of weekdays between two dates, but I want to do the reverse, i.e., determine
the day 16 WEEKdays in the future.

How is that done?
 
A

Al Campagna

LA Lawyer,
Given a starting date, create a loop that adds one day to that date
at a time. (ex. a variable called NextDate, and a variable called Ctr)
If that NextDate is a weekday...
WeekDay(NextDate) = 2 or 3 or 4 or 5 or 6
then increment Ctr.
Ctr = Ctr + 1
When Ctr = 16, bail out of the loop, and the current NextDate value
will be your answer.

--
hth
Al Campagna
Microsoft Access MVP 2007-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 

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