Eloquence Query Manual

C Math Operations

Mathematical operations are used in the FIND command's search expression. The following describes valid operators for mathematical operations in a search expression:

 
+addition/division
-subtraction*multiplication
ANDlogical ANDPOSposition function
ORlogical OR=equal to
>greater than#not equal to
<less than<>not equal to

Examples

Suppose that you wanted to find data entries where the data item NAME equals "Hewlett-Packard". The search expression to be used with the FIND command would be:

   NAME = "Hewlett-Packard"
Now suppose that you want to find data entries where the data item NAME equals "Hewlett-Packard" and where the data item ORDER_NO equals "1000". The search expression would be:

   NAME = "Hewlett-Packard" AND ORDER_NO = "1000"
If you wanted to find all data entries where the data item NAME does not equal "Hewlett-Packard" or where the data item ORDER_NO equals "1000", you would use the following search expression with the FIND command:

   NAME # "Hewlett-Packard" OR ORDER_NO = "1000"
Suppose that you wanted to find all data entries where the data item PRICE is greater than or equal to "1000". The search expression would be:

   PRICE >= "1000"
Now suppose that have a large database of products and want to find all products where the profit is less than "100". You might use the following search expression:

   (PRICE - DISCOUNT) < (COST + "100")
As a final example, suppose that you want to find all data entries where the data item NAME contains "John"; NAME may contain more than "John", but you only want to know if "John" is somewhere in NAME. The search expression would be:


POS(NAME,"John") > "0"
If the string "John" is located anywhere in the value of NAME, POS returns a numeric value indicating the location where "John" begins. Thus if "john" is part of the value of NAME, the value will be greater than 0 and the expression is true.

Chapter contents:


Eloquence Query Manual - 19 DEC 2002