assigning select to sqlquery.sql.text lazarus / 16-Databases ---------------------------------------------------------------------- yordan · 2010-12-20 11:21 What I'm trying to do is assign the sql command  select * from table_name where some_column like '%a%'  I have troubles to insert the '% character into the following command  sqlquery1.sql.text:='select * from grupist where name like'+ quotedstr(edit4.text)  When I try typing the following  sqlquery1.sql.text:='select * from grupist where name like'%'+ quotedstr(edit4.text) + '%''  it doesn't work properly(the compiler accepts the +quotedstr(edit4.text) part as a string and the % as an operator).  Can someone help ---------------------------------------------------------------------- clauslack · 2010-12-20 12:03 Try this sqlquery1.sql.text:='select * from grupist where name like'+ QuotedStr('%'+edit4.text+'%'); or sqlquery1.sql.text:='select * from grupist where name like'+ QuotedStr('%'+Trim(edit4.text)+'%'); ---------------------------------------------------------------------- yordan · 2010-12-20 12:08 Thanks man ---------------------------------------------------------------------- clauslack · 2010-12-20 12:40 Sorry Check for the space after 'like' sqlquery1.sql.text:='select * from grupist where name like '+ QuotedStr('%'+Trim(edit4.text)+'%'); before then final release check the sql sintax with ShowMessage(sqlquery1.sql.text); Regards