title: Getting history data from a table
body: <p>I have a <code>History</code> table in a SQL Server database that I need to get information from different months for example I have an <code>EmployeeHistory</code> table, this table has a record for any update that I'm doing for each employee. During a month I can have many updates but I only only the latest one. I for example I don't do any update during a month, I show go I get the latest update for that month. </p>
  
  <p>For example</p>
  
  <pre><code>ID Name Email           Date
  1  A    a@hotmail.com   2013-01-10
  1  A    new@hotmail.com 2013-01-20
  1  A    n1@hotmail.com  2013-03-15
  </code></pre>
  
  <p>In this case I don't have any changes in February but I need to bring it with the same data as January, in this case the latest one from January should be repeated in February so the query should bring this result:</p>
  
  <pre><code>ID Name Email           Date
  1  A    new@hotmail.com 2013-01-20
  1  A    new@hotmail.com 2013-01-20
  1  A    n1@hotmail.com  2013-03-15
  </code></pre>
  
  <p>How can I build the query for these cases?</p>
  
  <p>Thank you.</p>