Business days by year

  • Thread starter Secret Squirrel
  • Start date
S

Secret Squirrel

Is there an easy way to calculate the # of business days for a given year? I
have a table for my holidays and a table called "tblYears". I want to be able
to set up a query and have it calculate the total business days for each year
in my tblYears withonly having the actual year as a value to go by.
 
T

Tom van Stiphout

On Fri, 3 Oct 2008 19:45:00 -0700, Secret Squirrel

Best way I can think of is to loop over the days in the year, checking
for holidays, and adding up the businessdays. Such a loop should be
very fast if you handle the Holidays recordset efficiently.

-Tom.
Microsoft Access MVP
 
J

John W. Vinson

Is there an easy way to calculate the # of business days for a given year? I
have a table for my holidays and a table called "tblYears". I want to be able
to set up a query and have it calculate the total business days for each year
in my tblYears withonly having the actual year as a value to go by.

Something like:

DateDiff("d", DateSerial([Year], 1, 1), DateSerial([Year] + 1, 1, 1) -
DCount("*", tblHolidays)

This assumes that weekends are included as holidays - which might be a good
idea if you want to leave the freedom to go to four day weeks (or six day
weeks for that matter).
 

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