Hi and Hello.

i have sql query 

SELECT issued_date, sum( `no_of_misprint` ) AS Total_Sum
FROM `patient_card`
WHERE issued_date = '2010-05-26'
GROUP BY `issued_date`

i have made this query in action

    $c = new Criteria();
     $c->clearSelectColumns();
     $c->addSelectColumn(PatientCardPeer::ISSUED_DATE);
      $c->addSelectColumn(PatientCardPeer::NO_OF_MISPRINT);
       $c->addAsColumn('Total_Sum',COUNT('.PatientCardPeer::NO_OF_MISPRINT.'));
       $c->add(PatientCardPeer::ISSUED_DATE,date('Y-m-d'),Criteria::EQUAL);
       $c->addGroupByColumn(PatientCardPeer::ISSUED_DATE);
       $this->sum= PatientCardPeer::doSelect($t)

is above query in right ....?

plz any one help to build criteria according to sql query.... and how should i 
access above certial using sum with alias in template.


Help me ..
Thanks in advance..
                                          
_________________________________________________________________
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to