title: How can I update the end date to the value of the following records start date?
body: <p>I have a table <code>[RoleHistories]</code> table with columns:</p>
  
  <blockquote>
    <p>[RoleHistoryId] [PersonId] [Start] [End]</p>
  </blockquote>
  
  <p>The Start column is populated with a date. The end column is null. There are multiple rows per person. I need to update the end column to have a date that is the start date of the next record. If there is no subsequent record the end should remain null</p>
  
  <p>E.g. </p>
  
  <pre><code>RoleHistoryId = 999, PersonId =1, Start=2009-1-1, End=null
  RoleHistoryId = 2677, PersonId =1, Start=2011-5-1, End=null
  RoleHistoryId = 4637, PersonId =1, Start=2013-9-1, End=null
  </code></pre>
  
  <p>I would want </p>
  
  <pre><code>RoleHistoryId = 999, PersonId =1, Start=2009-1-1, End=2011-5-1
  RoleHistoryId = 2677, PersonId =1, Start=2011-5-1, End=2013-9-1
  RoleHistoryId = 4637, PersonId =1, Start=2013-9-1, End=null
  </code></pre>