title: SQL Server 2008: Get date part from datetime2
body: <p>I've been using this very handy method of extracting the date portion from a <code>datetime</code> value:</p>
  
  <pre><code>select dateadd(day, datediff(day, 0, @inDate), 0)
  </code></pre>
  
  <p>This basically zeroes out the time portion of the date. It's fast, and more importantly it's deterministic - you can use this expression in a persisted computed column, indexed view, etc.</p>
  
  <p>However I'm struggling to come up with something that works with the <code>datetime2</code> type. The problem being that SQL Server does not permission conversions from integers to the <code>datetime2</code> type.</p>
  
  <p>Is there an equivalent, <strong>deterministic</strong> method of stripping the time portion from a <code>datetime2</code>?</p>