This is the query:
select sum(a.cotizado),count(a.estado) from 
(
select sum(d.cotizado) cotizado,m.reg_cotizacion,m.estado 
        from m_cotizacion as m 
join d_cotizacion as d on m.cod_cotiza = d.cod_cotiza
where m.fecha between "2015-01-01" and "2015-05-17"
group by m.reg_cotizacion
) as a group by a.estado

i have this:
$qb = $em->createQueryBuilder();     
          $resumen_detalle_estado = $qb->select('SUM(d.cotizado) 
cotizado,m.regCotizacion,m.estado')
                        ->from('ErpPlanillasBundle:MCotizacion','m')
                        
->Join('ErpPlanillasBundle:DCotizacion','d',\Doctrine\ORM\Query\Expr\Join::WITH,"m.codCotiza
 
= d.codCotiza")                     
                        ->where('(m.fecha >= :f_inicio and m.fecha <= 
:f_final)')    
                        
->setParameter('f_inicio',$filter_form->get('desde')->getData())
                        
->setParameter('f_final',$filter_form->get('hasta')->getData())
                        ->groupBy('m.regCotizacion');
          $resumen_totales_estado = 
$qb1->select('sum(a.cotizado),count(a.estado)')
                        
->addSelect("(".$resumen_detalle_estado->getDQL().")")
                        ->groupBy('a.estado'); 

Can any body help me?


-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to