title: select conditional data in groups
body: <p>I have a table that contains a list of machines that are loaned out to users. An entry is made each time a machine is returned our taken out. I use the following statement to return a list by user, machine#, date, and action</p>
  
  <pre><code>SELECT Name, Asset#, Date, InOut
  FROM Table
  ORDER BY Asset#, date asc
  </code></pre>
  
  <p>Which returns</p>
  
  <pre><code>Name      Asset#       Date        InOut
  Jimmy     BER210    2009-05-08      out
  Jimmy     BER210    2009-06-08      in
  Jimmy     BER210    2009-07-08      out
  Sam       BER220    2009-05-08      out
  Sam       BER220    2009-06-08      In
  Jack      BER230    2009-05-08      out
  Jack      BER230    2009-06-08      In
  Jack      BER230    2009-07-08      out
  </code></pre>
  
  <p>I am looking for assistance modifying that query to return ONLY the most recent entry, and ONLY if that machine is currently out.</p>
  
  <p>Thanks in advance for any asstance you can provide! </p>