But read this post:

http://teknoid.wordpress.com/2008/09/29/dealing-with-calculated-fields-in-cakephps-find/

Cake will not put the data for the calculated field under the model
name in the data array. Put Teknoid's code in your AppModel and you'll
be good to go.

On Wed, Sep 30, 2009 at 3:20 PM, Edinei L. Cipriani <[email protected]> wrote:
> Hi,
>
> $this->Model->find('all', array('fields' =>
> array('Model.id'.'SUM(Model.price) AS price' ));
>
> Regards
>
>
> 2009/9/30 DAM <[email protected]>
>>
>> I'm developing web based application.
>> example table
>> create table item{
>> ....
>> price decimal(12,2) notnull,
>> ....
>> }
>>
>> I want to show sum of price.How I can do it?
>>
>> SQL query ( SELECT SUM(price) as price FROM.....)
>>
>> but I want to that implement using cakephp.
>>
>> Please help me This is for my university project.
>>
>>
>
>
>
> --
> Edinei L. Cipriani
> Desenvolvedor Colégio Trilingue Inovação
> www.colegioinovacao.com.br
> Cursando Sistemas de Informação  - Unoesc Chapecó 1 Período
> Integrante do grupo Fool N Lost de algoritimos computacionais
> Fone 49 84149086
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to