Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save e-vural/34f5cb3c28368a525489 to your computer and use it in GitHub Desktop.
Save e-vural/34f5cb3c28368a525489 to your computer and use it in GitHub Desktop.
we will use SUBSTRING function
$monht = 12; or 11 or 01 your choice
$variable = $em->createQueryBuilder()
->select('sd')
->from('YourEntitypath','sd')
->where('SUBSTRING(sd.fulltime,6,2) =:month') 6,2 important
->andWhere('sd.otherwhere =:other')
->setParameter('month',$monht)
->setParameter('other',$var)
->orderBy('sd.fulltime','ASC')
->getQuery()
->getResult();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment