4D v14.3Query by formula |
||
|
4D v14.3
Query by formula
Query by formula
You can use a Query by Formula to find records based on the results of a calculation or data manipulation. The expression you write must equal either TRUE or FALSE for each record. You can use any function in the language as well as any project methods specifically designated by the developer. A Query by Formula is useful for composing queries that involve operations such as the following:
Here are some examples of queries by formula:
However, the formula: [Stats]Annual Sales/[Stats]CostOfLiving is incorrect because it returns a numeric value, not TRUE or FALSE. You can only write formulas that are one logical line long. That is, you cannot press the Carriage return key on the keyboard and write a second line. The editing area, however, will wrap to the next line if the statement is too long. If you need to use a formula that is more than one line, write it as a project method and call this method in the formula. Queries by formula are written in the standard query editor, where a query by formula is an advanced query mode. To define a query by formula, display the Query editor and then Alt+click (Windows) or Option+click (OS X) on the add line button . Note: For a single-line query by formula, delete the first line added by default. The added line then includes additional menus:
Through this new functioning, query by formula criteria can be combined with standard query criteria: Due to their integration into the standard query editor, queries by formula benefit from the same functionality as standard queries:
|
PROPERTIES
Product: 4D SEE ALSO ARTICLE USAGE
4D Design Reference ( 4D v14 R2) Inherited from : Query by formula ( 4D v12.4) |