From: Howard Roberts Date: 2008-07-22T04:09:06+09:00 Subject: Re: Grouping/Sorting an Array of objects Pe単a, Botp wrote: > try, > > @data.sort_by{|rec| [rec.date, rec.class, rec.name]} > > or something like that. Something like that is probably what I need, because the app doesn't like that line for me. > it would be nice if you can post some sample data so we can test it > immediately. i'm a slow typist ;) some sample data and pseudo code is here: http://ruby.pastebin.com/m24b5e03 The output I'm trying to achieve would look like the following, listing first the date, then the information all of the first objects , and then all of the second objects for that date: 7/18/08 9:00 AM - Orientation Location: Conference Room Welcome, review agenda, and brief Q&A 7:30 AM - First Event The Smiths invite you for a casual breakfast at Grumpy's 7/19/08 8:00 AM - Workshop I Location: Room 106 Boring, all day presentation by Dr. Jones 7/20/08 6:00 PM - Second Event The Jones invite you for a Sociable Dinner at La Nepolara's 7/21/08 8:00 AM - Workshop II Location: Room 108 Yet another boring, all day presentation by Dr. Jones 2:30 PM - Wrap-Up Location: Room 108 Summary, Q&A, and lots of free goodies 7:30 AM - Third Event The Smiths invite you for a casual Breakfast at Mel's 1:00 PM - Fourth Event Dr. Jones and Staff invite you for a Business Lunch at The Krusty Krab > kind regards -botp Thank you kindly for replying and a for any suggestions you might offer. Howard -- Posted via http://www.ruby-forum.com/.