View Single Post
  #3 (permalink)  
Old 01-14-2009, 1:13 PM
MattP MattP is offline
VB.NET Forum Idol
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Feb 2008
Location: USA
Posts: 877
Reputation: 500
MattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond repute
Default

Another way to look at it is the difference between the last time and the first time divided by the number of times it's in the file minus 1.

This should get you the same results minus the headache of the first post.

Code:
SELECT MachineName, (DATEDIFF(minute, MIN([Date Time]), MAX([Date Time]))) / (COUNT(MachineName) - 1) As MTBF
FROM SomeLogTable
GROUP BY MachineName
ORDER BY MachineName
Reply With Quote