Sunday, February 19, 2012

DateDiff: Calculating working days

I am trying to use the DateDiff function to calculate the difference between two dates in working days only... Is this possible in SSRS 2005, or can anyone suggest an alternate solution?

Yes, this is possible; however, normally you must account for holidays and when all is said and done I would suggest that you give a look to this article:

http://sqlserver2000.databases.aspfaq.com/why-should-i-consider-using-an-auxiliary-calendar-table.html

This discusses establishing a calendar table which ought to help with computing "working days".

( Adolf: what does "NB" stand for? )

|||NB this article doesn't discuss different sets of holidays

e.g. england, wales, scotland, ireland

have different public holidays despite being in the UK

you may wish to add extra columns to cater for this|||thank you.. I've decided to pinch the calendar table off another db and will try to follow the examples.

No comments:

Post a Comment