![]() |
|
||||||||
| Site Links |
| Consulting |
| Knowledge Base |
| Training |
| Forum |
| Articles |
| Resources |
| Products |
| Cool Tools |
| Contact |
| About Us |
| Go to Page... |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
|
Hi there...can anyone tell me the Access equivalent for Excel's NETWORKDAYS function? I'm trying to use DATEDIF, but I don't see an option to include a list of holidays.
Thanks! |
|
Local Time: 11:53 PM
Local Date: 05-23-2013 Location:
|
|
|
|
#2 |
|
|
Are you in the UK or elsewhere? If you are in the UK I can give you something that will calculate all working days and remove public holidays from the equation.
If not, I can give you the basic workdays formula. I also have some US holiday formulae. Another method is to set a reference to Excel and make use of the NETWORKDAYS formula. |
|
Local Time: 05:53 AM
Local Date: 05-24-2013 Location:
|
|
|
|
#3 |
|
|
I'm afraid there is no equivalent in Access. You need to create your own table of holidays and write your own function. I'll knock something up and post back - if no one else does so first.
Enjoy, Tony --------------------------------------------------------------- Give a man a fish and he'll eat for a day. Teach him how to fish and he'll sit in a boat and drink beer all day. I'm (slowly) building my own site: www.WordArticles.com |
|
Local Time: 05:53 AM
Local Date: 05-24-2013 Location:
|
|
|
|
#4 |
|
|
Nope, I am in the US. Thanks!
|
|
Local Time: 11:53 PM
Local Date: 05-23-2013 Location:
|
|
|
|
#5 |
|
|
Tony...I've seen the following from another board, but I can't quite see how to post the holidays:
VBA:
VBA tags courtesy of www.thecodenet.com
|
|
Local Time: 11:53 PM
Local Date: 05-23-2013 Location:
|
|
|
|
#6 | |||||||||||||||||||||||
|
|
Scrub that; I forgot that NETWORKDAYS isn't a standard function and is part of the Analysis Toolpak. Have a look at Pat Hartman's database on this forum. This extra post by myself here may also be of some interest to you. |
|||||||||||||||||||||||
|
Local Time: 05:53 AM
Local Date: 05-24-2013 Location:
|
|
|
|
#7 |
|
|
Abulafia...the function you pointed me to works great. I think this thread can be considered SOLVED. But, the user will have to create a new table called tblHolidays (below) within the same DB as the code for it to work. Easy enough to do. THANKS!!!!
1/1/20015/28/20017/4/20019/3/200111/22/200111/23/200112/25/20011/1/20025/27/20027/4/20029/2/200211/28/200211/29/200212/25/2002 1/1/20035/26/20037/4/20039/1/200311/27/200311/28/200312/25/20031/1/20045/31/20047/5/20049/6/200411/25/200411/26/200412/24/200412/31/2004 Last edited by TonyJollans : 07-23-2004 at 07:02 AM. Reason: Break long string |
|
Local Time: 11:53 PM
Local Date: 05-23-2013 Location:
|
|
|
|
#8 |
|
|
YUK...sorry for the terrible post!
|
|
Local Time: 11:53 PM
Local Date: 05-23-2013 Location:
|
|
|
|
#9 |
|
|
babsc01 - that routine takes in an array of holidays, something like ..
VBA:
VBA tags courtesy of www.thecodenet.com
Then call like .. .. or without declaring your own array, you can just do .. VBA:
VBA tags courtesy of www.thecodenet.com
Seems little point in me knocking anything up now ![]() Enjoy, Tony --------------------------------------------------------------- Give a man a fish and he'll eat for a day. Teach him how to fish and he'll sit in a boat and drink beer all day. I'm (slowly) building my own site: www.WordArticles.com |
|
Local Time: 05:53 AM
Local Date: 05-24-2013 Location:
|
|
|
|
#10 |
|
|
I edited your post - just broke the long string in two
Enjoy, Tony --------------------------------------------------------------- Give a man a fish and he'll eat for a day. Teach him how to fish and he'll sit in a boat and drink beer all day. I'm (slowly) building my own site: www.WordArticles.com |
|
Local Time: 05:53 AM
Local Date: 05-24-2013 Location:
|
|
![]() |
| Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|


