Page 1 of 1

Filter property problem

Posted: 13.10.2010, 13:56
by almi
Hi,

Context :
Delphi 2007 + MySql 4.1 (Connection protocol : mysql-4.1)

I have one aliased request (see sample) :

SELECT A.field1, A.field2, B.Field1, B.Field2 FROM TableA As A inner join TableB As B on A.KeyField = B.foreignField

If i add this filter : A.field3 like 'my criteria%'

The Filter assignation crash with this message : Unknow symbol ''.''

Witch solution do you have for this problem ?

Best regard,

Posted: 13.10.2010, 19:46
by guidoaerts
you can only filter on fields in the resultset, so add A.field3 to your select ;
or add a WHERE clause to your sql
Guido

Posted: 14.10.2010, 12:33
by almi
Ok Guido,

Tank for your answer but my problem is not solved with your information.
I have the same result error.

The problem seems to stem from the query using aliases.

Alain

Posted: 08.11.2010, 00:15
by mdaems
No Almi,

The problems is that you are confusing the filer with a sql 'where' clause.
In a filter the columns should be named the way they are named in the resultset. This means as 'field3' when the field is included in the select. Anther thing to remember is that the like is a special operator in a filter which behaves like this (from a text by Guy Fink):
The LIKE-Operator calls the pattern matching function IsMatch.
Examples from the source file :
IsMatch allows unix grep-like pattern comparisons, for instance:
? Matches any single characer
* Matches any contiguous characters
[abc] Matches a or b or c at that position
[^abc] Matches anything but a or b or c at that position
[!abc] Ditto
[a-e] Matches a through e at that position
'ma?ch.*' -Would match match.exe, mavch.dat, march.on, etc
'this [e-n]s a [!zy]est' - Would match 'this is a test',
but would not match 'this as a yest'
Mark