title: Aggregate on datetime in sql with group by
body: <p>The following are available <a href="http://www.w3schools.com/sql/sql_functions.asp" rel="noreferrer">aggregate functions</a> for SQL</p>
  
  <pre><code>AVG() - Returns the average value
  COUNT() - Returns the number of rows
  FIRST() - Returns the first value
  LAST() - Returns the last value
  MAX() - Returns the largest value
  MIN() - Returns the smallest value
  SUM() - Returns the sum
  </code></pre>
  
  <p>I need to apply aggregate function on datetime field? It is not listed there. Max(), Min() will not work. What I would need is either </p>
  
  <ul>
  <li>return the latest date </li>
  <li>return the earliest date</li>
  </ul>
  
  <p>Is it possible. Can I implement it somehow?</p>