title: From raw sql query to symfony 2 sql query
body: <p>I have this sql query:    </p>
  
  <pre><code>SELECT * from gift WHERE NOW() &gt;= `validbegin` AND NOW() &lt;= `validend` ORDER BY `points`n ASC
  </code></pre>
  
  <p>I need to transform it to a Symfony 2 query to fetch the data to an object call Gift. So far I have this:</p>
  
  <pre><code>    $query = $giftRepository-&gt;createQueryBuilder('p')
          -&gt;where('NOW() &gt;= validbegin AND NOW() &lt;= p.validend')
          -&gt;orderBy('p.points', 'ASC')
          -&gt;getQuery();
      $gifts = $query-&gt;getResult();
  </code></pre>
  
  <p>But that gave me:</p>
  
  <blockquote>
    <p>[Syntax Error] line 0, col 53: Error: Expected known function, got
    'NOW'</p>
  </blockquote>
  
  <p>Any idea?</p>
  
  <p>ps. Also tried p.NOW()</p>