title: Select info from table where row has max date
body: <p>My table looks something like this:</p>
  
  <pre><code>group    date      cash  checks
    1    1/1/2013     0      0
    2    1/1/2013     0      800
    1    1/3/2013     0      700
    3    1/1/2013     0      600
    1    1/2/2013     0      400
    3    1/5/2013     0      200
  </code></pre>
  
  <p>-- Do not need cash just demonstrating that table has more information in it</p>
  
  <p>I want to get the each unique group where date is max and checks is greater than 0. So the return would look something like:</p>
  
  <pre><code>group    date     checks
    2    1/1/2013    800
    1    1/3/2013    700
    3    1/5/2013    200
  </code></pre>
  
  <p>attempted code:</p>
  
  <pre><code>SELECT group,MAX(date),checks
      FROM table
      WHERE checks&gt;0
      GROUP BY group
      ORDER BY group DESC
  </code></pre>
  
  <p>problem with that though is it gives me all the dates and checks rather than just the max date row.</p>
  
  <p>using ms sql server 2005</p>