title: Flagging rows where a value changed from previous row
body: <p>I have a query that is tracking production.  Whenever a unit is produced I capture the timestamp, part number, delta time, and what the cycle time should have been, as well as others that aren’t important to list here.  In a SSRS report I count the rows and group them by hour and run efficiency calculations each hour based on the cycle times divided by the deltas.  What I need is to add a column in my select statement that will flag whenever a part number changes so I can identify when a changeover has occurred by referencing it in my report.   </p>
  
  <p>Example: Select part number of row – part number of previous row as changeover</p>
  
  <p>Every row would have a value that would always be 0 unless a changeover occurred then it would be a different value for that one row.  I could have my report do its thing on any value &lt;> 0.</p>