title: SQL select MAX value from last day
body: <p>I have a table with DateTime and Value columns. I need to select max value from the last day (newest) day. The best I could come up with is 3 step process:</p>
  
  <ol>
  <li><code>SELECT MAX(DateTime) FROM MyTable</code></li>
  <li>get rid of time part in datetime, store date</li>
  <li><code>SELECT MAX(Value) FROM MyTable WHERE DateTime&gt;date</code></li>
  </ol>
  
  <p>Is there a better way to do this?</p>