0

I need mysql date function in order by as I only want to sort with date not dateTime.

 $dql  = "SELECT r FROM Entities\Reservation r ";
 $dql .= "JOIN r.lot l ";
 $dql .= "LEFT JOIN r.car c";
 $dql .= " WHERE l.id = '" . $lot->id . "'" ;
 $dql .= " AND r.complete ='1' ";
 $dql .= " AND r.cancelled=0";
 $dql .= " ORDER BY r.start DESC, c.is_disabled_person DESC";        

 $query = $this->getEntityManager()->createQuery($dql);
 $query = $this->getResult();
Zubair
  • 1
  • Have you tried `$dql .= " ORDER BY DATE(r.start) DESC, c.is_disabled_person DESC";` Is there some reason that presents problems? – O. Jones Jul 20 '17 at 21:59
  • Yes I tried that but it gives me error "expectd end of string got (" – Zubair Jul 21 '17 at 22:52

0 Answers0