Siegfried: I was using 1.2.0.7962 but I just downloaded the latest version.
I dont think its a problem with the query itself because I dont get any SQL error messages. I think it is how its being reference in the view. How would you reference the return p10 in your view? I keep getting Undefined index: body when using $post['Post']['body']. Thanks for the help! On Feb 5, 11:54 am, Siegfried Hirsch <[email protected]> wrote: > Hello gkc, > > I have just tried the following in my app: > > $vendors = $this->find('all', > array('conditions'=>array('vendor_id >' => 0), > 'contain'=>array('Vendor.shortname'), > > 'fields'=>array('left(Item.product,10) as p10, COUNT(*) as count'), // > 'Item.vendor_id, > 'group'=>array('Item.vendor_id'), > 'order'=>array('COUNT(*) desc'), > //'recursive'=>-1, > ) > ); > > This works like a charm for me. > > Array > ( > [0] => Array > ( > [0] => Array > ( > [p10] => 6ES5721-0C > [count] => 3173 > ) > > [Vendor] => Array > ( > [shortname] => XYZ > [id] => 377 > ) > > ) > > [1] => Array > ( > [0] => Array > ( > [p10] => POG90 2048 > [count] => 404 > ) > > [Vendor] => Array > ( > [shortname] => Tha > [id] => 35 > ) > > ) > > Which version of cake are you using ? > > On Thu, Feb 5, 2009 at 6:35 PM, gkc <[email protected]> wrote: > > > Alfredo, > > > Thank you for finally responding. I REALLY NEED HELP WITH THIS!!!! > > Dont cry ;) > > Siegfried --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
