Friday
Apr112003
LotusScript to calculate business days
April 11, 2003
We don't use Notes/Domino 6 at work yet, so I can't use the new @BusinessDays function. And I really needed a LotusScript function to calculate business days. Not finding one on the web, I wrote this one.
My goal is to make this script library much more functional. For now, you simply call a function, passing the start and end dates. The function returns the business days, inclusive of the start and end dates if they are business days. One of the next things I'll add is a lookup to the public NAB to retrieve holidays, but for now you supply those in a list in the script library. I also plan to add another function to return a business date that is X number of business days from the start date -- useful for an approvals routine I need to do.
So here's the early version. I've done a fair amount of testing, but keep me honest and test it yourself before putting it into a production routine!
Click to view libBusinessDays
My goal is to make this script library much more functional. For now, you simply call a function, passing the start and end dates. The function returns the business days, inclusive of the start and end dates if they are business days. One of the next things I'll add is a lookup to the public NAB to retrieve holidays, but for now you supply those in a list in the script library. I also plan to add another function to return a business date that is X number of business days from the start date -- useful for an approvals routine I need to do.
So here's the early version. I've done a fair amount of testing, but keep me honest and test it yourself before putting it into a production routine!
Click to view libBusinessDays
Reader Comments