title: How to compare datetime field from Doctrine2 with a date?
body: <p>I want to get the items which were created today with by a QueryBuilder from Doctrine2. I want to compare the createdAt(Datetime) field with today parameter(Date). Is it possible to do that in one query?</p>
  
  <pre><code>$qb = $this-&gt;createQueryBuilder('i');
  $qb-&gt;innerJoin('i.type', 'it');
  $qb-&gt;andWhere('it.name = :type');
  $qb-&gt;andWhere('i.createdAt &lt; :today');
  // i.createdAt == datetime and :today parameter is a date
  </code></pre>