title: Float as DateTime
body: <p>SQL Server 2008</p>
  
  <p>I almost have, I think, what I'm looking to do. I'm just trying to fine tune the result.  I have a table that stores timestamps of all transactions that occur on the system. I'm writing a query to give an average transaction time.  This is what I have so far:</p>
  
  <pre><code>With TransTime AS (
    select endtime-starttime AS Totaltime 
      from transactiontime
     where starttime &gt; '2010-05-12' and endtime &lt; '2010-05-13')
  Select CAST(AVG(CAST(TotalTime As Float))As Datetime) 
    from TransTime
  </code></pre>
  
  <p>I'm getting the following result:</p>
  
  <p><strong>1900-01-01 00:00:00.007</strong></p>
  
  <p>I can't figure out how to strip the date off and just display the time, 00:00:00:007.  Any help would be appreciated. Thank you.</p>