title: Sql 2005 get latest entry from a group of data
body: <h2>Problem:</h2>
  
  <p>I have a set of data that keeps track of history of communication between clients. So each client has their own activity history (notes, emails..etc). I need to get the latest entry from each client's activity history, where each row is the latest entry from a client's activity. So every row is unique on <strong>client id</strong> and we can call each activity, <strong>"description"</strong>.</p>
  
  <p>Each activity has a date, and some other jargon like subject, body.</p>
  
  <h2>Activity Table</h2>
  
  <pre><code>activityid  |  clientid  |  subject  |  body  |  datemodified
  </code></pre>
  
  <p>Thanks!</p>