I need to count days (business days) between two dates excluding weekend (most important) and holidays
SELECT DATEDIFF(end_date, start_date) from accounts >
Try This Code this will Calculate no of days Excluding Weekends
SELECT (DATEDIFF(dd, @StartDate, @EndDate)+1) -(DATEDIFF(wk, @StartDate, @EndDate) * 2) from test_tbl where date NOT IN (SELECT date FROM holidaydatestable )