title: Retrieve the previous date for each record SQL Server
body: <p>I would like to retrieve the previous customer contract effective date for each record. How do I write a query such that it will give me the following result? This is for sql server. Do I use over <code>partition by</code>? Thanks!</p>
  
  <pre><code>Customer Eff_Date   Previous_Eff  
       A    1/1/2013    NULL   
       A    2/1/2014    1/1/2013   
       A    3/1/2015    2/1/2014    
       B    2/1/2014    NULL   
       B    3/1/2014    2/1/2014  
  </code></pre>