title: SQL get the last date time record
body: <p>I'm trying to get the last datetime record from a table that happens to store multiple status.
  My table looks like so:</p>
  
  <pre><code>+---------+------------------------+-------+
  |filename |Dates                   |Status |
  +---------+------------------------+-------+
  |abc.txt  |2012-02-14 12:04:45.397 |Open   |
  |abc.txt  |2012-02-14 12:14:20.997 |Closed |
  |abc.txt  |2013-02-14 12:20:59.407 |Open   |
  |dfg.txt  |2012-02-14 12:14:20.997 |Closed |
  |dfg.txt  |2013-02-14 12:20:59.407 |Open   |
  +---------+------------------------+-------+
  </code></pre>
  
  <p>The results should be </p>
  
  <pre><code>+---------+------------------------+-------+
  |filename |Dates                   |Status |
  +---------+------------------------+-------+
  |abc.txt  |2013-02-14 12:20:59.407 |Open   |
  |dfg.txt  |2013-02-14 12:20:59.407 |Open   |
  +---------+------------------------+-------+
  </code></pre>