ZQuery Filter Problem.. lazarus / 16-Databases ---------------------------------------------------------------------- FezaCakir · 2016-09-12 09:16 Hi everybody. The Code is: with QXList do begin   FilterOptions:=[foCaseInsensitive];   Filtered:=False;   Filter:='XName like ''%'+edSearch.Text+'%''';   Filtered:=True;  end; It doesn't work. Do I wrong something? Thanks.. ---------------------------------------------------------------------- FezaCakir · 2016-09-12 09:26 I fixed and it works. I replaced % with *. with QXList do begin   FilterOptions:=[foCaseInsensitive];   Filtered:=False;   Filter:='XName like ''*'+edSearch.Text+'*''';   Filtered:=True;  end; ---------------------------------------------------------------------- btr0001 · 2024-10-02 09:13 How did you gess to use * instead of &? ---------------------------------------------------------------------- af0815 · 2024-10-02 10:01 The useable wildcard depends on your DB. Please read the doc for your used DB. One short hint here https://www.w3schools.com/sql/sql_wildcards.asp ---------------------------------------------------------------------- Sieben · 2024-10-02 10:16 @FezaCakir: I suggest using QuotedStr in your Filter expression instead of multiple single quotes: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   Filter := 'XName = ' + QuotedStr('*'+edSearch.Text+'*'); Makes it more readable and avoids errors. And please use the Insert Code button to format code parts of your messages. @af0815: SQL dialect doesn't matter here as TDataSet.Filter is purely a client side operation and doesn't reach out to the DBMS. ---------------------------------------------------------------------- dseligo · 2024-10-02 10:25 Quote from: btr0001 on October 02, 2024, 11:13:47 amHow did you gess to use * instead of &? Probably not a guess. Look at documentation: https://www.freepascal.org/docs- html/fcl/db/tdataset.filteroptions.html ---------------------------------------------------------------------- rvk · 2024-10-03 10:51 I'm not familiar with TZQuery but if you want to use LIKE (and other SQL server related filter structures) you might want to use ServerFilter instead of Filter. Filter is executed on client side while ServerFilter is sent to the server along with the SQL (in fact the SQL is changed on the fly then). https://www.freepascal.org/docs- html/fcl/sqldb/tsqlquery.serverfilter.html I don't know if TZQuery has a ServerFilter though.