We have a table of users, each user having a monthly "goal" number. As a company, we need a snapshot of the combined goal of all users. However, we also need to be able to go back in time and see what a goal was for a specific month. Since our "users" table is versioned, I know the data is there. However, for a specific date, I''m having trouble avoiding a separate query for each user''s goal, mainly because there are many other fields in the users table causing each user to have multiple versions within a month. So if user A has 10 different versions for January, summing up the goals for January will count that user''s goal 10 times. Any suggestions? Thank you! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---