title: Find a gap between time stamp
body: <p>I have many many rows in the table. The table has a Date column (which includes date and time)</p>
  
  <p>I want to be able to loop through the table and find any gap between the two rows where the difference between the row is 5 min.</p>
  
  <p>For example:</p>
  
  <pre>
  ID Date
  1 2014-07-29 13:00:00
  2 2014-07-29 13:01:00
  3 2014-07-29 13:07:00
  </pre>
  
  <p>So as you can see the time difference between the first row and second row is 1 min so I ignore, then I should be checking the time between the second row and third row. Since the time difference is 6 min I want to spit out an exception with the dates that were compared.</p>
  
  <p>The table could contain many rows, so I would go and check the next record to the previous one and so one...</p>
  
  <p>How could I achieve this in SQL Server. I can do a datediff, but I will have a lot of rows and I don't want to perform this manually.</p>
  
  <p>Any suggestions?</p>
  
  <p>NOTE* I don't need to worry about the cross over of hours from one day to another, since this task is only going to be used for a single day. I will specify on SQL statement where date = getdate()</p>