title: Using `DATE()` in Doctrine Querybuilder
body: <p>I need to get all rows where <code>DATE(a.when)</code> matches the string <code>2014-09-30</code>.</p>
  
  <pre><code>$builder = $this-&gt;em-&gt;createQueryBuilder();
  $builder-&gt;select('a')
          -&gt;from('Entity\Appointment', 'a')
          -&gt;andWhere('a.when = :date')
          -&gt;setParameter('date', $date);
  </code></pre>
  
  <p><code>a.when</code> is a full <code>DATETIME</code>; <code>:date</code> is only a <code>string</code> (in <code>DATE</code> format).</p>
  
  <p>The following and variations didn't work:</p>
  
  <pre><code>        -&gt;andWhere('DATE(a.when) = :date')
  
  Error: Expected known function, got 'DATE'
  </code></pre>
  
  <p>What's the correct usage here?</p>