title: How to exclude dates from a table when searching between two dates?
body: <p>I have created a query where it can search between two dates to calculate working days excluding bank holidays.</p>
  
  <p>I have created a table with dates inside of bank holidays</p>
  
  <p>How can i create a query where when searching between the two dates, it excludes the dates within the table?</p>
  
  <p>Here is what i have so far...</p>
  
  <pre><code> DECLARE @StartDate DATETIME
     DECLARE @EndDate DATETIME
  -- Calculate the calendar working days below INCLUDING BH
  --YEAR/MONTH/DATE
      SET @StartDate = '2016/09/01'
      SET @EndDate = '2016/09/30'
      SELECT
         (DATEDIFF(dd, @StartDate, @EndDate) + 1)
        -(DATEDIFF(wk, @StartDate, @EndDate) * 2)
        -(CASE WHEN DATENAME(dw, @StartDate) = 'Sunday' THEN 1 ELSE 0 END)
        -(CASE WHEN DATENAME(dw, @EndDate) = 'Saturday' THEN 1 ELSE 0 END)
         DECLARE @TotalDays INT, @WorkDays INT
         SET @TotalDays = (DATEDIFF(dd, @StartDate, @EndDate) +1)
         print @TotalDays
  </code></pre>