Retrieve Spec Programming One of the new features in Q&A 4.0 is the ability to use programming logic to retrieve records. Retrieve Spec Programming to uses Boolean statements that return either a true or false statement. Those records for which the statement is 'true' are retrieved. The following are examples of a few simple boolean statements. Salary: {Salary > 10,000} - this will retrieve all records for which the salary is greater than 10,000. This is a very basic statement. The same thing could be Salary: > 10,000 done with '>10,000' in the field. Retrieve Spec Programming allows for the comparison of two different fields within one record. For example; Salary: Bonus: {Bonus > (Salary * .10)} - This would retrieve records where an employee received a bonus that was greater than 10% of their salary. *** The programming statement can appear in any field in the record. It does not have to be placed in a field pertaining to the statement. You can also do multiple 'AND' and 'OR' statements. Be careful about the placement of parenthesis so that your request is clear. Last Name: {Hired Date >= @D(1985/01/01) or (Manager = "John Smith" and Evaluation >= 5)} This statement would retrieve employees hired in 1985 or later. It would also retrieve employees who report to John Smith and received an evaluation of 5 or better. More complicated statements would allow you to search for a value in any of several fields. The follow example might apply to an invoice file that contained a specific part description in any of four fields. In the example the Part field would have to formatted as a 'TEXT' field. Part1: { @Instr ( ( Part1 + "," + Part2 + "," + Part3 + "," + Part4), "Widget") >0)} This would string together all the values in the part fields. You would have, in affect, "Gasket,Widget,Thingagig,". The @INSTR function finds the location of the Widget in that string. In this case it would return the value 8. Since 8 is greater than 0 the record would be retrieved. If the word widget did not appear in any of the fields the value 0 would be returned and the record would not be retrieved. Q & A Application Note Rev. 6/92 #2121 Page 1 of 1