The application tests the first condition for being "true" or "false".
It then tests the second condition for being "true" or "false".
If the separator between the two conditions is AND, both conditions must be "true". If the separator is OR, at least one condition must be "true". The application stores the result of this test as "true" or "false".
It then tests the third condition for "true" or "false".
It compares result of the first and second condition test to the result of the third condition.
If the separator in front of the third condition is AND, both the prior result and the third condition must be "true". If the separator is OR, at least one of them must be "true". The result is now reset to "true" or "false."
If there are additional conditions, the application compares the result of the prior condition tests to the next condition and produces a new result.
When it tests the last condition, it accepts or rejects the record depending on the final "true" or "false" result.
To make it easier to construct multiple condition tests, you can use a formula with associated conditions enclosed with parentheses.
For a brief example:
If you add the following three conditions in this order:
Job = 03-001
AND cost code = 2-075
AND category = M
The application searches all of the records to first retrieve job 03-001, then it searches through those records to find the cost code 2-075 within the job 03-001, then lastly it searches within the job 03-001, cost code 2-075 for categories M.
If you add them in this order:
Job = 03-001
OR cost code = 2-075
AND category = M
The application searches all the records to find the job 03-001. Then it searches all of the records again to find all cost codes 2-075 regardless of their job number. Then within the jobs 03-001 or cost codes 2-075 it searches for category M.
The results of each of those sets of conditions could vary greatly.
Using AND/OR in formulas
You can use formulas as conditions to determine whether to include records in an inquiry or a report. These conditions must always start with the IF function. There may be instances when you need more than one condition to make this determination. In these cases, you must separate each condition the next one by using the AND or OR operator. The tests described above apply.
To make the conditions easier to construct and understand, use parentheses to group the conditions. For example, IF condition1 AND condition2 OR condition3 AND condition4 is a string of conditions in which it is not readily apparent how the individual conditions relate to each other. By using parentheses, you can create a more logical and understandable testing combination. For example, IF (condition1 AND condition2) OR (condition3 AND condition4) means that if conditions 1 and 2 are met, OR if conditions 3 and 4 are met, it accepts the record. The application calculates formula components inside parentheses before those that are outside parentheses. |