|
FAQ>Databases |
|
|
Set a filter using compound criteria |
|
|
Article #: |
0011 |
|
Contributor: |
Daniel Todes |
|
GF version: |
All |
|
Applies to: |
Setting filters on DataLinks |
|
Last updated: |
July 5, 2001 |
Question
How do I dynamically set a filter on a group of records in a data source using a combination of criteria?
Answer
Filter using more than one set of criteria (AND):
Simply place the FillPoints containing the criteria one after the other. This will filter the records first according to the criteria in the first FillPoint, then according to the criteria in the second FillPoint.
e.g.,%[DetailsDataLink.SetFilter('Surname','=',Profiles.Surname)]%[DetailsDataLink.SetFilter('Married','=','True')]
Filter using a list of optional values (OR):
Set a filter using the "In" filter constant and a list of values. This task searches the set of records for those records that contain the values specified.
e.g.,%[DetailsDataLink.SetFilter('Surname','In',"('Smith','Jones','Brown')")]
Filter using a set of criteria that you do NOT want the record to contain:
Set a filter using the "<>" filter constant.
e.g.,%[DetailsDataLink.SetFilter('Surname','<>',Profiles.Surname)]
Template Example
|
LEASE TERMINATION AGREEMENT %[Lease=Databases.Select('\Demo','Lease')] %[Lease.SetFilter('Landlord', 'In', "('Matthew Brown','Janet Bartlet')")] %[~Lease.ChooseRow()]
This Lease Termination Agreement is entered into by and between %[Lease.Landlord], an individual with an address of %[Lease.Landlord_Address] ("Landlord"), and %[Lease.Tenant], an individual with an address of %[Lease.Tenant_Address] ("Tenant").
|
Click here to view the filtered data selection interface.