From: Brian Candler Date: 2009-01-20T00:22:52+09:00 Subject: Re: comparing date problem Sam Ginko wrote: > I have a set of dates in my database and would like to only get the > latest one or the one closest to the current date. I'm trying to come up > with a way of doing it but had no luck. If any one could help I would > appreciate it. SQL problem? Show the SQL you've written already. Consider using the max() operator. There are some good examples at http://dev.mysql.com/doc/refman/5.0/en/examples.html (which may be useful even if you're not using MySQL) ORM problem? Solution will depend on which ORM you are using (e.g. ActiveRecord, Datamapper, Sequel, Og, ...). -- Posted via http://www.ruby-forum.com/.