Link to home
Start Free TrialLog in
Avatar of Idiotboy
Idiotboy

asked on

Filtering a table

I need to filter a table so i can display the correct records.  The problem is that I have about 3 or 4 critera's to meet but I keep getting an error when trying to complile.
The code I am using
Tab is a variable defined before the filter is set.

tbapptsearch.Filter := 'chiropractor_id =' + inttostr(tab)
 and 'status = '  +  quotedstr('pending');
The error I get points to the 2nd +.
[Error] datamod2.pas(187): Operator not applicable to this operand type.

Now if I do it like this.
tbapptsearch.Filter := ('chiropractor_id =' + inttostr(tab))
 and ('status = '  +  quotedstr('pending'));
I get the same error but it points to the ;.

My usuall style of trial and error codeing is failing me at this point.
ASKER CERTIFIED SOLUTION
Avatar of Lee_Nover
Lee_Nover

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Idiotboy
Idiotboy

ASKER

Thanks Lee,  worked like a charm.

If you have time could you explain how the %d and %s works in your example.  I think i know, but haven't had the time to experiment with it yet.
%d is a holder for Integer numbers
%s is for strings

look up the Format function