title: "where" clause with only the month
body: <p>What I want to do is to get all the days-off in my db for a given month.</p>
  
  <p>I tried multiple solutions and none of them work. I ended by doing black magic with doctrine (kinda).</p>
  
  <p>Here's my last attempt :</p>
  
  <pre><code>public function getNbCongesByMonth($month){
      $listOfEntities = $this-&gt;createQueryBuilder('e')
          -&gt;select('count(e) as nb, SUBSTRING(e.cngDateDebut, 6, 2) as day')
          -&gt;where('day = :month')
          -&gt;setParameter('month', $month)
          -&gt;getQuery()
          -&gt;getResult();
      return $listOfEntities;
  }
  </code></pre>
  
  <p>The request is supposed to return the amount of "Conges" in the database for a precise month. </p>
  
  <p>With this request I got this error :</p>
  
  <pre><code>An exception occurred while executing 'SELECT count(c0_.CNG_ID) AS sclr0, SUBSTRING(c0_.CNG_DATE_DEBUT FROM 6 FOR 2) AS sclr1 FROM Conges c0_ WHERE sclr1 = ?' with params ["5"]:
  
  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sclr1' in 'where clause' 
  </code></pre>
  
  <p>I have no ideas how to do that anymore so if someone has a solution that would be awesome.</p>
  
  <p>Thanks in advance.</p>