Accessibility
 
Home > Products > UltraDev > Support > Building Common Applications
Dreamweaver UltraDev Icon Macromedia Dreamweaver UltraDev Support Center - Building Common Applications
Including records based on a combination of search conditions

This section describe how to include records in the results recordset based on a combination of search conditions. You combine search conditions in SQL using the AND , OR , and NOT logical operators.

If you want all the conditions to be true for a record to be included in the recordset, use the AND operator as follows:

...WHERE LASTNAME LIKE 'varLastName' AND DEPARTMENT LIKE 'varDept' 

If you want any one of the conditions to be true for a record to be included in the recordset, use the OR operator as follows:

...WHERE LASTNAME LIKE 'varLastName' OR DEPARTMENT LIKE 'varDept' 

If you want one condition to be true but not another, use the NOT operator as follows:

...WHERE DEPARTMENT LIKE 'varDept' NOT COUNTRY LIKE 'varCountry' 

You can use parentheses to group search conditions:

...WHERE (DEPARTMENT LIKE 'varDept' AND STARTDATE < #varStart#) OR STARTDATE BETWEEN #varStartRange# AND #varEndRange# 
To Table of Contents Back to Previous document Forward to next document