From: Rajat Garg Date: 2008-03-18T15:21:02+09:00 Subject: Issue with SQL like ------=_Part_16103_12343597.1205821271917 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Guys, I am a newbie, so excuse me if this is a lame question - I am writing a query - Airport.find(:all, :conditions =>["owner_city_state_zip like '%?%'", _tempZip.zip]) Now, this gives an 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 '97103'%')' at line 1: SELECT * FROM airports WHERE (owner_city_state_zip like '%'97103'%') How do I format my query to get rid of this problem? Also, how do we write a query to written say, 2 fields out of table instead of all the fields. Thx, -- Rajat Garg Ph: 206-499-9495 Add: 1314 Spring Street, #412 Seattle, WA 98104 Web: http://www.pilotoutlook.com ----------------------------------------------------------------------------------------------------- Flying is the second greatest thrill known to man. Landing is the first! ------=_Part_16103_12343597.1205821271917--