So Spiceworks has helped me before with this sort of thing.
Disclaimer: I'm not really a database guy, I'm just doing this for a report to help out our production with reducing downtime and I can't wrap my head around how to do it.
Using a single DATETIME column: I need to find the starting time, any gap in records of greater than 5 minutes, and the ending time. I'm including a small sample set that covers a break.
Text
datekilled 1 2018-02-14 09:12:49.000 2 2018-02-14 09:13:32.000 3 2018-02-14 09:13:58.000 4 2018-02-14 09:15:42.000 5 2018-02-14 09:31:15.000 6 2018-02-14 09:32:41.000 7 2018-02-14 09:33:24.000 8 2018-02-14 09:34:25.000
In this example, I would like the query to return line 4 as the starting time, line 5 as the ending time, and the datediff(in minutes) between the two times.
The query will be running on a report that's...