php - symfony2 group by date query -
code follows, trying group transactions date. if use group year(t.createddate), month(t.createddate), day(t.createddate)
i teh following error: [semantical error] line 0, col 173 near 'year(t.creat': error: cannot group undefined identification or result variable.
$transactions = $em->createquery("select sum(t.amount) amount, count(t.id) total xxxcreatormainbundle:transaction t t.createddate >= :createdstart , t.createddate <= :createdstop") ->setparameter('createdstart',$createdstart) ->setparameter('createdstop',$createdstop) ->getresult();
i need show total # of transactions , sum of amounts in day day fashion.. appreciated
neither of functions come build-in doctrine
, so must either register them manually or install doctrineextensions
github repo i'm sure has of them prepared use.
also, take @ tutorial (last code block, more precise) on how register functions doctrineextensions
.
hope helps....
Comments
Post a Comment