Hi, I am trying to get number of events of by a certain person in a time period. My activerecord syntax is: Event.count(:group => [ ''DATE(created_at), user_id'' ]) This returns something like: => [["1", 3], ["3", 1], ["4", 2], ["5", 1]] It should have an extra date field there. Running the logged query directly in mysql returns the proper result: SELECT count(*) AS count_all, DATE(created_at), user_id AS date_created_at_user_id FROM `events` GROUP BY DATE(created_at), user_id +-----------+------------------+-------------------------+ | count_all | DATE(created_at) | date_created_at_user_id | +-----------+------------------+-------------------------+ | 1 | 2008-05-08 | 1 | | 1 | 2008-06-08 | 1 | | 1 | 2008-06-20 | 3 | | 1 | 2008-06-24 | 1 | | 6 | 2008-07-08 | 1 | | 2 | 2008-07-08 | 4 | | 1 | 2008-07-08 | 5 | | 3 | 2008-07-09 | 1 | | 1 | 2008-07-09 | 3 | | 1 | 2008-07-09 | 5 | +-----------+------------------+-------------------------+ -- M. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---