Sunday, June 7, 2009

Business Day

What is Business Day ? Wikipedia define it as "A business day is any day including Monday to Friday and does not include holidays".

How many business day is between 2 dates ? like between June 4th 2009 and June 9th 2009.

In SQL Server, the number of days between 2 days can be calculated using datediff() function

SELECT days = DATEDIFF(DAY, '2009-06-04', '2009-06-09')

But this will give you 5 days.




The business days between June 4th 2009 and June 9th 2009 should be 3 excluding Saturday and Sunday.

So how to calculate the number of business days between 2 dates ?

I will go though various methods in my coming posts

Area to cover will be

No comments:

Post a Comment