Page 1 of 1

Feature request : extend the filter behaviour ( NOT keyword)

Posted: Tue 27 May 2008 19:25
by swierzbicki
Hi,

The filtering is working when the filter is filled with something like this :

Code: Select all

User like ‘root’
The filtering is no more working when the filter is filled with something like this :

Code: Select all

User not like ‘root’
I know that I've already asked you for this... but right now I can't use the workarrounds you told me
- using the filter thids way

Code: Select all

 NOT User LIKE  ‘root’ 
- using the filterSQL property : I'm using a cxgrid that automatically fill the filter property.

Posted: Wed 28 May 2008 07:52
by jkuiper_them
Why not rephrase your sql with the option SQLWHERE instead of filters :?:

Posted: Wed 28 May 2008 14:13
by swierzbicki
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