From: Taneal Bhandari Date: 2009-04-22T05:32:03+09:00 Subject: Re: comparing date problem I'm having a similar issue, but can't seem to figure out what the solution is. Here's my code: now = Time.now @events = Event.find(:all, :conditions => ["event_date > " + now.to_s, {:venue_id => @venue.id}]) Basically, I want to pull all the records from the Events table where the event_date has not passed. The code above is generating the following error: "Mysql::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Apr 21 16:31:05 -0400 2009)' at line 1: SELECT * FROM `events` WHERE (event_date > Tue Apr 21 16:31:05 -0400 2009)" -- Posted via http://www.ruby-forum.com/.