Board index » cppbuilder » use of AND in the FILTER statement

use of AND in the FILTER statement

I have a problem about the use of AND in a FILTER statement, working
whith Borland Builder

In the HELP Menu.SETTING THE FILTER PROPERTY. We can read:
" ... you can create fairly sophisticated filters. The following
statement checks to make sure that two test conditions are met before
accepting a record
(Custno > 1400) AND (Custno < 1500)
... "

In my applicattion, if I write:
ModuloDatos->TUP->Filter = ("UP_Subespecie = '" + DBLCBPlts->Text +"'")
AND("S_H = 'S'");
where:
 ModuloDatos->TUP----is a table in a DataModule
 UP_Subespecie---------is a table (TUP) field name
 DBLCBPlts->Text------is a BDLookupComboBox selection
 S_H--------------------is a table (TUP) field name
 S-----------------------is a value field

I get the error:
 Statement missing;

I cant understand where is the problem. Could you help me ?
Thank you in advance for your cooperation

 

Re:use of AND in the FILTER statement


Quote
"Zapata, Jose Maria" wrote:

> I have a problem about the use of AND in a FILTER statement, working
> whith Borland Builder

> In my applicattion, if I write:
> ModuloDatos->TUP->Filter = ("UP_Subespecie = '" + DBLCBPlts->Text +"'")
> AND("S_H = 'S'");
> where:
>  ModuloDatos->TUP----is a table in a DataModule
>  UP_Subespecie---------is a table (TUP) field name
>  DBLCBPlts->Text------is a BDLookupComboBox selection
>  S_H--------------------is a table (TUP) field name
>  S-----------------------is a value field

ModuloDatos->TUP->Filter = "(UP+Subespecie = '" +  DBLCBPlts->Text
        + "') AND (S_H = 'S')";

Should do it.

Cheers,
--
Michael Lockey
director, Hartlepool Systems International
note: $10.00 fee (US) for all unsolicited spam mail.  This includes all
mail that is not either specifically requested, or a personal
communication.  By sending me anything that may qualify as spam, you
have agreed to the terms and conditions of my service.  If in any doubt,
you may send me an enquiry as to whether or not your message will be
construed as Spam.  There is no charge for this service.

Other Threads