ZTable filter syntax lazarus / 16-Databases ---------------------------------------------------------------------- sorinr · 2011-09-27 05:29 Hello everybody, I just can't remember the correct syntax to filter a ztable in Lazarus. I have a ztable, a grid populated from the ztable with the datasource pointing to ztable and an edit field. Can anyone help me with the correct syntax for the filter? I've tried: ztable.filter='myfield like '+QuotedStr(edit.text)+'%'; but its not working. What I'm doing wrong? Thanks ---------------------------------------------------------------------- Arbee · 2011-09-27 09:02 A Guess .... You code: Code: [Select].... QuotedStr(edit.text)+'%'; That would give something like Code: [Select].... "sometext"% whereas I assume you want Code: [Select].... "sometext%" So perhaps (untested): Code: [Select].... QuotedStr(edit.text+'%'); (and maybe you also want to remove leading and trailing spaces from edit.text too) ---------------------------------------------------------------------- sorinr · 2011-09-27 11:38 Thank you Arbee for your post. With your help I have remebered the right syntax that is: ztable1.Filtered:=false;  ztable1.FilterOptions:= [foCaseInsensitive];  ztable1.Filter:= 'myfield LIKE ' + QuotedStr(edit1.Text+'*');  ztable1.Filtered:=true;