Filter statement for filtering multiple fields

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
info@eventsoft.nl
Posts: 6
Joined: Sat 06 Jan 2018 15:37

Filter statement for filtering multiple fields

Post by info@eventsoft.nl » Sat 08 Feb 2020 01:54

Hi

I can't figure out whats the correct syntax for filtering on multiple fields.

for 1 field i use :
dmCrew.Contact.Filter:='Status='+QuotedStr('Active');

for 2 fields i tried:
dmCrew.Contact.Filter:='Status='+QuotedStr('Active')+' AND '+'LastName='+QuotedStr('Mierlo');

ViktorV
Devart Team
Posts: 2870
Joined: Wed 30 Jul 2014 07:16

Re: Filter statement for filtering multiple fields

Post by ViktorV » Tue 11 Feb 2020 12:59

Yes, you can use this code to solve the defined task.

Post Reply