title: return number of days between two date columns in SQL
body: <p>I've seen a very few questions like this one but none have a solution that quite works with with the structure I have.</p>
  
  <p>My current query creates a table with 4 columns, 2 of which are dates.</p>
  
  <p>I declare this as a table <code>@tblTransactions</code> which I later call in a select statement. 
  I need the final select statement to have a 5th column which shows the number of days between the two dates.</p>
  
  <pre><code>SELECT *
         ,(t.PremDueDate - t.LastTdate) AS 'tpFactor'          &lt;-------- This doesn't work
  FROM
         @tblTransactions t
  </code></pre>
  
  <p>the above code obviously doesn't work since PremDueDate and LastTdate are both of datatype <code>date</code>. </p>
  
  <p>Using SQL Server Management Studio 2010</p>