Hi jkuiper_them,
Why not rephrase your sql with the option SQLWHERE instead of filters Question
This will works with simple SQL statements like 'Select * from Table'.
In my case, I'm joining differents tables. These tables are sometimes sharing the same fieldname (used for joining). The generated filter expression doesn't know anything from the underlaying table so I can't take it and used it as an SQLFilter.
Exemple 1 :
MySQL TableA : IdA , Reference, CustId...
MySQL TableB : CustId, Name, Street....
Code: Select all
TmyQuery SQL Statement : Select TableA.reference,TableA.CustId,TableB.Name from tableA inner join tableB on (tableA.custid = table2.custid)
TMyQuery will retreive fields Reference,CustId,Name
In my cxgrid, I set a filter on the CustId column. The cxgrid will generate a filter expression like this CusId = 1233.
I can't fill the SQLFilter with the generated filter expression. I will get an exception (and that's right) about ambigious CustId field....
Exemple 2 :
MySQL TableA : Id,ValueA,ValueB,ValueC
Code: Select all
TmyQuery SQL Statement : Select ID, (ValueA+ValueB)/ValueC as) ExpressionA
TMyQuery will retreive fields ID,ExpressionA
In my cxgrid, I set a filter on the ExpressionA column. The cxgrid will generate a filter expression like this ExpressionA= 27.56
I can't fill the SQLFilter with the generated filter expression. I will get an exception (and that's right) about an non existant field
Exemple 3 :
MySQL TableA : Id,ValueA,ValueB,ValueC
Code: Select all
TmyQuery SQL Statement : Select ID, ValueA,ValueB,ValueC
TMyQuery will retreive fields ID,ExpressionA. Add all persistent fields + create an calculated field....
In my cxgrid, I set a filter on the Calculated column. The cxgrid will generate a filter expression like this Calculeted = 27.56
I can't fill the SQLFilter with the generated filter expression. I will get an exception (and that's right) about an non existant field