Function to Calculate Business Days

We have run into several scenarios where it would be convenient to be able to determine if a specific date was a business day or not.

For example, one application we have is used for approval of time off. It would be useful to have a function that would return if a specific date was a business day or not, based on the Business Hour Calendar that is already part of AgileApps.

Also, it would be great to have a function that would calculated how many business days between 2 dates.

Is there any such functionality available?

There was a problem with my responses not loading in the Forum. Here was my first post:


I wrote code for a client to compute business days between any two dates. I will try to find it.

In the meanwhile, you might do it yourself. It was not hard. As I recall, I computed the number of full weeks by simply dividing by seven.
Then multiply that number by five.

Then compute the number of days in a partial last week. Add this to the result above.

Now comes the somewhat hard part that may be specific to your company. I created a simple set of tables by going to the web to get the dates/days of all “floating” holidays (e.g. Thanksgiving) that are weekdays. See if there are any such days in the range, and subtract from the previous total.

Then another set of tables for fixed holidays (e.g. New Years day).

What is nice is that you can easily adapt this to environments where the work week is not monday to friday and can easily accomodate any holidays specific to another location (national holidays, religious holidays, etc.)


My second post was after locating the code/article., it is attached below. The article starts on page 10.

IN Vol 18 No 1.pdf (434 KB)