title: how can i convert a datetime to int?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5505935/convert-from-datetime-to-int">Convert from DateTime to INT</a>  </p>
  </blockquote>
  
  
  
  <p>For performance reasons, I would like to add a computed column to my table. </p>
  
  <p>I am doing lots of queries like this:</p>
  
  <pre><code>select * from mytable where mydate between @start_date and @end_date
  </code></pre>
  
  <p>instead of the above query I would like to do this:</p>
  
  <pre><code>select * from mytable where my_computed_column between number1 and number2
  </code></pre>
  
  <p>What is the best way to convert <code>datetime</code> to <code>int</code>?</p>