title: SQL from a given value, get all top and bottom rows until this value changes
body: <p>I have a local SQL Express where I am doing some queries from vb.net. However, no success with following one. If I have something like,</p>
  
  <pre><code>dateTime              var1  
  
  2015/08/10 18:35:00   1
  2015/08/10 18:36:00   1
  2015/08/10 18:37:20   2
  2015/08/10 18:38:00   2
  2015/08/10 18:39:00   2
  2015/08/10 18:40:00   2
  2015/08/10 18:39:20   1 
  2015/08/10 18:40:00   2
  </code></pre>
  
  <p>from a known dateTime and var1, I would like to get all top and bottom rows until var1 changes.
  For example, from "2015/08/10 18:38:00","2" I should get,</p>
  
  <pre><code>2015/08/10 18:37:20   2
  2015/08/10 18:38:00   2
  2015/08/10 18:39:00   2
  2015/08/10 18:40:00   2
  </code></pre>