Query Criteria Operators

When you define a query, you establish a set of conditions each record must meet to be included in it. To establish these requirements, apply the criteria operators to the fields you select to use as filter fields for the query output.

Note: You can use wildcard characters with certain criteria operators to further refine your search. For information, refer to Wildcard Characters in Query . Also, some of the criteria operator labels that appear for date fields use different terminology so you can more easily associate them with dates. For information, refer to Query Criteria Operators for Date Fields.

Operator

Description

Equal to

When you select this condition, the program returns records that include the exact value you define. For example, if you select City is "Equal to" Portsmouth, the results only include records with the exact entry of Portsmouth as the city.

Not equal to

When you select this condition, the program returns records that do not include the exact value you define.

For some fields, the Only return records that do not have a value equal to the selected value checkbox appears. To not return records associated with the value selected for the field, regardless of whether the record is associated with additional values for the field, select this checkbox. For example, if Robert Hernandez has multiple constituencies of Board Member, Volunteer, and Alumnus, and you select Constituency is "Not equal to" Alumnus, the results will not include Robert’s Alumnus constituency record or any other constituency records for Robert.

If you do not select the checkbox, the results do not include records associated with Alumnus, but do include records for Robert's additional constituencies.

Note: The Include blanks checkbox appears for the criteria operators of "Not equal to," "Not one of," "Less than," "Less than or equal to," "Not between," "Not like," and "Does not contain." To include records with no entry for the selected field, select this checkbox. If the checkbox is not selected, records with no entry for the field do not appear in the results. From Administration, you can use the Enable/Disable default blank query criteria configuration task select whether to select Include blanks by default.

One of

When you select this condition, the program returns records that include one of the values you define.

For some fields, the Only return records that match all selected values checkbox appears. To return only records that match all the values defined, select this checkbox. For example, Robert Hernandez has multiple constituencies of Board Member, Volunteer, and Alumnus. You select Constituency is “One of” Alumnus or Volunteer and select the Only return records that match all selected values checkbox. Returned results will include all constituencies for Robert as well as any other constituents associated with both the Alumnus and Volunteer constituencies.

If you do not select the checkbox, the program returns constituent records associated with either Alumnus or Volunteer or both. The constituent does not have to be associated with both constituencies, but must be associated with at least one of the constituencies. Returned results will include all constituencies for Robert as well as any other constituents who meet the criteria.

Not one of

When you select this condition, the program returns records that do not include any of the values you define.

Less than

When you select this condition, the program returns records that include a value less than the one you define.

Less than or equal to

When you select this condition, the program returns records that include a value less than or equal to the one you define. For example, if you select Age is "Less than or equal to" 25, the results include records with an age value of 25 or younger. The results also include records with the value you select, in this case 25.

Greater than

When you select this condition, the program returns records that include a value greater than the one you define. For example, if you select Age is "Greater than" 25, the results include records with an age value older than 25. The results do not include records with an age value of 25 or younger.

Greater than or equal to

When you select this condition, the program returns records that include a value greater than or equal to the one you define. For example, if you select Age is "Greater than or equal to" 25, the results include records with an age value of 25 or older. The results also include records with the value you select, in this case 25.

Between

When you select this condition, the program returns records that include a value within the range you define. The operator is inclusive. For example, if you select Age is "Between" 25 and 30, the results include records with an age value between 25 and 30, as well as records with an age value of 25 or 30.

Not between

When you select this condition, the program returns records that do not include a value within the range you define. This operator is exclusive. For example, if you select Age is "Not between" 25 and 30, the results include records with an age value before 25 and after 30. The results do not include records with an age value equal to 25 or 30.

Like

When you select this condition, the program returns records with a value that is spelled like the one you define. With this condition, you can use the “_” and “%” wildcard characters to replace characters in a field.

Not like

When you select this condition, the program returns records with a value that is not spelled like the one you define. With this condition, you can use wildcard characters to replace characters in a field.

Begins with

When you select this condition, the program returns records with a value that begins with the one you define. For example, if you select Last name "Begins with" Bell, the results include records with a last name value that begins with "Bell," such as Bell, Bellmont, or Bellingham. With this condition, you can use wildcard characters to replace characters in a field.

Does not begin with

When you select this condition, the program returns records with a value that does not begin with the one you define. For example, if you select Phone number "Does not begin with" 800, the results include records without numbers that begin with 800. With this condition, you can use wildcard characters to replace characters in a field.

Blank

When you select this condition, the program returns records that do not include an entry in the field. For example, if you select City is "Blank," the results include records without a city value specified for the address.

Not Blank

When you select this condition, the program returns records that include an entry in the field. For example, if you select Country is "Not blank," the results include all records with a country value.

Contains

When you select this condition, the program returns records with a value that includes the one you define. For example, if you select City "Contains" York, the results include any records with "York" anywhere in the City field, such as York, York City, and New York. With this condition, you can use wildcard characters to replace characters in a field.

Does not contain

When you select this condition, the program returns records that do not include the value you define anywhere in the field. For example, if you select City "Does not contain" London, the results exclude records with London anywhere in the City field, such as London, New London, and Londonderry. With this condition, you can use wildcard characters to replace characters in a field.

Under

The “under” operator is used to filter data stored hierarchically. When you select this condition, the results include all records that are children of the selected parent field.

Not under

The “Not under” operator is used to filter data stored hierarchically. When you select this condition, the results include all records that are not children of the selected parent field.

Sounds like

When you select this condition, the program uses an algorithm included with Microsoft SQL Server to return records that sound like the value you define. For example, if you select Last name "Sounds like" Smith, the results include all records with Smith and names that sound similar, such as Smyth. With this condition, you can use the “_” and “%” wildcard characters to replace characters in a field.

Query Criteria Operators for Date Fields

Date Filters for Date Fields

Query Combining Operators

Wildcard Characters

Compare Output Field Values

Summarize Query Output

 

 

You are here: Overview > Need Help with Analysis? > Information Library > Ad-Hoc Queries > Create Ad-Hoc Queries > Query Criteria Operators