By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,905 Members | 1,783 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,905 IT Pros & Developers. It's quick & easy.

count days

P: 28
I want to count the number of days reference a shipping order. I need to exclude weekends and holidays. Thank you.
Sep 15 '07 #1
Share this Question
Share on Google+
2 Replies


Scott Price
Expert 100+
P: 1,384
I want to count the number of days reference a shipping order. I need to exclude weekends and holidays. Thank you.
Hello Dean,

This thread: Calculate end date (working day) in Access has a function written to count week days (excluding week-ends).

Excluding holidays will be a little more difficult, since these change depending on country, region, etc. As far as I know, Access/VBA does not have a list of holidays built-in so you will likely have to create one that applies to your corner of the world.

To do this, you'll create a table, call it tblHolidays, give it a primary key of HolidayID Autonumber, second field is HolidayDate, third is HolidayName.

You'll have to open this into a recordset programatically and loop through comparing each date with the fixed holiday date to get your day count minus holidays. Then you can run the result through the weekday count function to return a final number of working days.

We'll be happy to help on any parts of this you don't understand, or get stuck on, but we'll wait until you make a start since we can't do the work for you :-)

Regards,
Scott
Sep 17 '07 #2

NeoPa
Expert Mod 15k+
P: 31,492
A new thread (Count Working Days) has been created from a hijack post added in here.
Jul 6 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.