title: Maximum time period
body: <p>I have a dataset that lists ID's (EmployeeID), the time period in quarters and years, four digit code, last two numbers of year are first 2 numbers, quarter number is second two.  Quarter 1 of 2013 would be '1301' (Quarter)  It includes active and previous employees.  It also has sales (Sales).  The dataset has one row per ID, per quarter.   I need sales at the  most recent quarter.   </p>
  
  <p>here is my code: </p>
  
  <pre><code>select EmployeeID, max(Quarter), Sales
  from dataset;
  </code></pre>
  
  <p>Clearly this is wrong because it wants me to group by employeeid and sales etc and it gives me multiple rows for each employeeid.   </p>
  
  <p>See above. </p>
  
  <p>I need output of 1 row  per EmployeeID giving me their most recent quarter and sales during that quarter.</p>