From: Sam Ginko Date: 2009-01-20T00:36:58+09:00 Subject: Re: comparing date problem Brian Candler wrote: > 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, ...). I'm using thinking sphinx search engine. an sql syntax in thinking sphinx looks like this @allRooms = Room.search :conditions => {:created_at => here is where I should have a statement} -- Posted via http://www.ruby-forum.com/.