Board index » cppbuilder » And Or with Filter

And Or with Filter


2006-06-09 03:40:30 AM
cppbuilder32
Hi, I want to select peoples between 20 and 25 and do a Logic "And" to them
via Sex suck as male or female.
For example there is 800 males and 750 females, ages between 13 to 89.
I want to filter and have list of peoples between 20 and 25 who are
male(female);
How?
I tried
AnsiString MyStr="fenale";
Table1->Filter="sex='"+MyStr+"'";
Table1->Filtered=true;
and anybody can tell me how can I do the rest?
Thanks :-)
 
 

Re:And Or with Filter

Hi,
You can write filter conditions using the SQl way :
Table1->Filter="sex='"+MyStr+"' and age <= 25 and age>= 20";
Check the help file. Search for "Filter,TDataSet" .
HTH
Jayme.
"Babak" < XXXX@XXXXX.COM >escreveu na mensagem
Quote
Hi, I want to select peoples between 20 and 25 and do a Logic "And" to
them
via Sex suck as male or female.
For example there is 800 males and 750 females, ages between 13 to 89.
I want to filter and have list of peoples between 20 and 25 who are
male(female);
How?
I tried
AnsiString MyStr="fenale";
Table1->Filter="sex='"+MyStr+"'";
Table1->Filtered=true;
and anybody can tell me how can I do the rest?
Thanks :-)