tsql - SQL Stored Procedure: Business Hours -


How can I create a stored procedure that accepts a start and end date? (Eg 1 April - 30 April

1) Get business days including Saturday X (a value). + 2) Get the holidays x (a value)

and return the total.

I'm new to this, I think it will be a tsql function, hmm.

Any help would be appreciated.

Thanks

The simplest solution to this problem is to create a calendar table in which every There is a price for the day that you may want to consider, then you can add columns which show that this is a business day or holiday. With it, the problem gets thinner: