Networkdays? Does it work?

Kila

Registered User.
Local time
Today, 13:49
Joined
Mar 5, 2003
Messages
275
I have a friend (Really!) who has asked me how to calsulate the number of workdays between two dates. I did not know offhand, but a brief review of the Access help files revealed this:

NETWORKDAYS
Returns the number of whole working days between a start and end date, excluding weekends and any identified holidays.
If this function returns the #NAME? error value, you may need to install msowcf.dll <mk:@MSITStore:msowcrss.chm::/html/wxtbcNoATPFunctions.htm>.
Syntax
NETWORKDAYS(start_date,end_date,holidays)
Start_date is a date that represents the start date.
End_date is a date that represents the end date.
Holidays is an optional range of one or more days (holidays) to exclude from the working calendar.

I experimented with this myself in queries and reports, and was not able to get it to work. Is anyone familiar with this function? On a search of the Forum, I found many references to code to solve the problem, but nothing useful referencing "Networkdays". Is this function functional?

My friend (I really do have a friend!!) is a bit newer to Access than I am, and I don't think she has ever tried to use VBA. Is there an easy way for her to calculate workdays? I feel a bit like the blind leading the blind here!

Thanks for anything you can offer!
 
This an Excel function. You can read about it in Excel Help. If you want to use it in Access, you need to set a reference to the Microsoft Office Web Components library. I don't know what version of Excel first contained this function but my Excel 2002 has it. I am not familiar with using Excel functions within Access but you may need to qualify the function with the name of the object library.

PS, I tried to figure out the syntax and couldn't get it to work. However, on the bright side, there is a function that will do this in the useful date functions sample db. Just down load it from the sample thread. You may have to search for it since most people have their setting set to display only newer threads and so you may not see it.
 
Hmm.

Thank you for responding. This is interesting. Why would an Excel command come up under Access help from within Access?
 
Because the Access help file Sucks. VB and VBScript things also show but not everything.
 
It sucks all right!

Yes, Even I have noticed some errors. I use both Access 97 and 2000, and it is as if they forget to fix some of the help files when they upgrade. It would be nice if, when you discovered an error, you could fix it on your own machine so you would not have to re-discover the error the next time. Even the ability to make notes to the help files would be nice...like writing additional notes in the margins of your textbooks....What worked, what didn't, the short cuts, the extra steps you had to figure out b/c the help files left them out, references to related files, etc.
 
Thanks to Mile-O-Phile....

There is a brilliant programmer who has made life easier for a lot of us and he has tackled this question for us as well. Click here to go to a thread where the code and a zipped database file exist, compliments of Mile-O-Phile, that you may find useful.
 
Thanks.

This is great! I have forwarded it to my friend. Thank you.

TessB said:
There is a brilliant programmer who has made life easier for a lot of us and he has tackled this question for us as well. Click here to go to a thread where the code and a zipped database file exist, compliments of Mile-O-Phile, that you may find useful.
 

Users who are viewing this thread

Back
Top Bottom