Page 1 of 1

TZQuery.Filter problems

Posted: 19.03.2014, 22:38
by time2fly
Problem 1:
This filter works: fieldname like "value*"
This filter does not work: fieldname like "*value*"

What am I doing wrong here?

Problem 2:
I have the following sql loaded in the TzQuery:
SELECT.. table1.name, table2.name,.. FROM ... INNER JOIN table1.. table2
Works fine, but when I add a filter of the following form, the "." is not accepted:
Filter: (table1.name like "value*") OR (table2.name like "value*")

How can I define a filert with redundant field names?

Re: TZQuery.Filter problems

Posted: 25.03.2014, 11:56
by time2fly
:( Can nobody help me? Am I the only one with these filter problems?

Re: TZQuery.Filter problems

Posted: 25.03.2014, 20:49
by mdaems
Without deeper study I can't answer your first question. But try debugging the IsMatch function in core\ZMatchPattern.pas.

For the second question: filters never become part of the query statement, so sql syntax doesn't work. You should give the result columns of your queries a unique name like
SELECT.. table1.name as name1, table2.name as name2,.. FROM ... INNER JOIN table1.. table2
Then your filter can reference the field names name1 and name2.

Mark