Mark Thomas wrote: >> Please help! :-( If I need to structure my query differently, I can. >> Ruby is so beautiful and I know I am missing some easy way to do this >> and for the life of me I can't figure it out on my own. > > It would help if you show your model or at least 'p @results'. Then > show what you want as output. For me at least, code will be easier to > decipher than what you mean by things like "tied back to the rep". Sorry about that. Here's a sample of the results after calling .inspect. Should help clarify the structure of my resultset. #<Client:0x4920884 @attributes={\"order_count\"=>\"4\", \"sales_day\"=>\"2009-04-13\", \"sales_rep\"=>\"Michael\"}>, #<Client:0x4920848 @attributes={\"order_count\"=>\"2\", \"sales_day\"=>\"2009-04-13\", \"sales_rep\"=>\"John\"}>, #<Client:0x492080c @attributes={\"order_count\"=>\"10\", \"sales_day\"=>\"2009-04-13\", \"sales_rep\"=>\"Jane\"}>, #<Client:0x49204c4 @attributes={\"order_count\"=>\"1\", \"sales_day\"=>\"2009-04-14\", \"sales_rep\"=>\"Michael\"}>, #<Client:0x4920488 @attributes={\"order_count\"=>\"9\", \"sales_day\"=>\"2009-04-14\", \"sales_rep\"=>\"John\"}>, #<Client:0x4920438 @attributes={\"order_count\"=>\"7\", \"sales_day\"=>\"2009-04-14\", \"sales_rep\"=>\"David\"}>, #<Client:0x49203e8 @attributes={\"order_count\"=>\"2\", \"sales_day\"=>\"2009-04-14\", \"sales_rep\"=>\"Albert\"}>]" -- Posted via http://www.ruby-forum.com/.