Help with determining deadlines

A

Al

By giving initial date and the number of Business Days (BD),excluding
holidays & weekends, I want to know what the date would be. For Example:

initial date = 11/15/2007
BD = 10
Deadline date = 11/30/2007
In the above period there are 3 days (weekends) and 2 days thanks giving.
any idea?
thanks
 
D

Douglas J. Steele

You have to tell it the holidays.

If you look, for example, at function dhAddWorkDaysA, you'll see its
declaration is

Public Function dhAddWorkDaysA(lngDays As Long, _
Optional dtmDate As Date = 0, _
Optional adtmDates As Variant) As Date

adtmDates As Variant is intended to be an array of dates representing the
holidays. See the comment:

' Example:
' dhAddWorkDaysA(10, #2/9/2000#, Array(#2/16/2000#, #2/17/2000#))
' returns #2/25/2000#, which is the date 10 work days
' after 2/9/2000, if you treat 2/16 and 2/17 as holidays
' (just made-up holidays, for example purposes only).

That makes it a little less useful in my opinion.
 
A

Al

This is what I am puzzled about. I only entered the business days to add and
the initial day like below:
Deadline = dhAddWorkDaysA(BD, Me.InitialDate)
BD was 50 and Initialdate was say today. I got the right answer. I double
checked it with your application and it came out with the same exact answer.
I am using a holiday table with your application, which is updated to the USA
Holidays of 2007 and 2008. On the other hand, I did not supply any holiday
dates to the other application as you see above, yet it came up with the
right answer. That is why I was asking where does it get the holidays from?
Al
 
D

Douglas J. Steele

Was the holiday table updated correctly in your copy of my sample database?
In other words, are you sure my application is missing holidays, or is it
just missing weekends?
 
A

Al

I updated the table in your application to 2007 and 2008 holidays. It did not
work when it had 2004 holidays which I understand why. Your application is
working without any problems. It is very clear to me how it works. My
question was regarding the first link in your response to me, the "Access
Web", because the code is not useing any table and it still gets the right
answer. It is not clear to me how it is determining the holidays?
Al
 
D

Douglas J. Steele

There's no way Ken's code from "The Access Web" includes holidays. My
question was have you double checked to ensure that it's giving the correct
answer? You've manually added 50 days to today and it's giving the correct
results?
 

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