title: Assign value with max date to variable
body: <p>I have table with fields <code>ID</code> and <code>date</code>, I need to assign newest date to a variable where <code>id</code> is some number.</p>
  
  <p>So if I have dates <code>2011-01-01</code> and <code>2011-02-02</code> where <code>ID = 1</code>, I need to assign <code>2011-02-02</code> to a variable.</p>