SQL Server 2008
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:
With TransTime AS (
select endtime-starttime AS Totaltime
from transactiontime
where starttime > '2010-05-12' and endtime < '2010-05-13')
Select CAST(AVG(CAST(TotalTime As Float))As Datetime)
from TransTime
I'm getting the following result:
1900-01-01 00:00:00.007
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.