I have a query where I am calculating total days between two days including start and end date by the following SQL query. If the end date is not null, then end date is cons
Take a look at the DATEDIFF MSDN page.
At the bottom of the page, there is some user-generated content.
One user posted a function there which does exactly what you want, including holidays (headline: "UDF to return the number of business days, including a check to a bank holidays table").