add 4 working days

  • Thread starter news.microsoft.com
  • Start date
N

news.microsoft.com

Hi,

I have a table of holidays and a date
I want to be able to add 4 working days excl. holidays to the given date

How can I do this?

Thanks
 
A

Allen Browne

Yes, there is.

You could create your table of holidays, DCount() the number found in the
date range you are interested in, and subtract from the result.
 
N

news.microsoft.com

Thanks for this
Is there a way so that the function can accept a variable for the Holiday
dates based on a table of hols.

If yes, how would I go about this?

Thanks

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

If dtmDate = 0 Then
dtmDate = Date
End If

dtmTemp = dtmDate
For lngCount = 1 To lngDays
dtmTemp = dhNextWorkdayA(dtmTemp, adtmDates)
Next lngCount dhAddWorkDaysA = dtmTemp
End Function
 
N

news.microsoft.com

Thanks but what I am trying to do is find a date 4 working days from a given
date.
The function that you pointed me to works fine if I hard code all the years
holiday dates - obviously I don't want to do this because they are always
changing.
I can't see how your next suggestion will help
Please explain
Thanks again for your help
 
E

Eric Butts [MSFT]

Hi,

Take a look at:

HOW TO: Determine If a Date Falls on a Weekend or on a Holiday in Access
2000
http://support.microsoft.com/default.aspx?scid=kb;en-us;210064

- and -

ACC2000: How to Find Number of Working Days Between Two Dates
http://support.microsoft.com/default.aspx?scid=kb;en-us;210562

I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support
[email protected]
"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."

This posting is provided "AS IS" with no warranties, and confers no rights

--------------------
| From: "news.microsoft.com" <[email protected]>
| Subject: add 4 working days
| Date: Mon, 7 Jun 2004 14:24:40 +0100
| Lines: 10
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
| X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
| Message-ID: <[email protected]>
| Newsgroups:
microsoft.public.access.modulesdaovba,microsoft.public.access.queries
| NNTP-Posting-Host: pc1.observer5.adsl.entanet.co.uk 81.31.98.234
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP0
8.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.access.queries:203027
microsoft.public.access.modulesdaovba:132275
| X-Tomcat-NG: microsoft.public.access.queries
|
| Hi,
|
| I have a table of holidays and a date
| I want to be able to add 4 working days excl. holidays to the given date
|
| How can I do this?
|
| Thanks
|
|
|
 
Top