5. Working with QBF Operations : QBF Retrieve Operation : Search Qualifications : How Comparison Operators Are Used
 
Share this page                  
How Comparison Operators Are Used
A comparison operator is a symbol that informs QBF that you want to compare two values or search for a range of data.
Qualify your query with these comparison operators.
Operator
Description
=
equal to
!=
not equal to
<
less than
<=
less than or equal to
>
greater than
>=
greater than or equal to
For example, the following figure shows a query that searches the Projects table for records with a budget greater than or equal to $12,000.
All comparison operators have equal precedence.
QBF assumes that fields containing values with no comparison operator have a defacto equals sign as the comparison operator. The equals sign works differently when querying non-nullable and nullable fields. For more information, see Queries in Blank and Nullable Fields (see page Queries in Blank and Nullable Fields).
Comparison operators are often combined with the AND operator within a field. For example, entering a search condition of >100 and <900 searches for all values between 100 and 900. You can also use the OR operator. For example, <100 or >900 searches for all values that are either less than 100 or greater than 900. Likewise, >=a <=d retrieves all character strings that begin with the letters a, b, c, or d.
When using a comparison operator on a character field, the search is case sensitive because QBF treats lowercase and uppercase characters as different characters. All uppercase letters come before all lowercase letters. If you enter >a, you cannot find any character strings that begin with uppercase letters, while if you enter >A <a, you can find all strings that began with uppercase letters but no strings that began with lowercase letters.
Just as capital letters are ordered ahead of lowercase letters, QBF orders numbers in a character field ahead of both uppercase and lowercase letters.
You cannot combine a greater than (>) or less than (<) comparison operator with pattern matching. For example, >Sa% is not allowed. For more information on pattern-matching, see Pattern-Matching Characters (see page Pattern-Matching Characters).