title: How can I SELECT distinct data based on a date field?
body: <p>I have table that stores a log of changes to objects in another table. Here are my table contents:</p>
  
  <pre><code>ObjID   Color   Date                     User
  ------- ------- ------------------------ --------
  1       Red     2010-01-01 12:22:00.000  Joe
  1       Blue    2010-01-02 15:22:00.000  Jill
  1       Green   2010-01-03 16:22:00.000  Joe
  1       White   2010-01-10 09:22:00.000  Mike
  2       Red     2010-01-09 10:22:00.000  Mike
  2       Blue    2010-01-12 09:22:00.000  Jill
  2       Orange  2010-01-12 15:22:00.000  Joe
  </code></pre>
  
  <p>I want to select the most recent date for each Object, as well as the Color and User on the date of that record.</p>
  
  <p>Bascically, I want this result set:</p>
  
  <pre><code>ObjID   Color   Date                     User
  ------- ------- ------------------------ --------
  1       White   2010-01-10 09:22:00.000  Mike
  2       Orange  2010-01-12 15:22:00.000  Joe
  </code></pre>
  
  <p>I'm having trouble wrapping my head around the SQL query I need to write to get this data...</p>
  
  <p>I am retrieving data via ODBC from an iSeries DB2 database (AS/400).</p>