To add a computed field to a form:
Click the Compute button in the Controls drop-down toolbar, or select Insert>Computed Field from the menu bar.
Click where you want the computed field.
The computed properties of the field display in the Properties view:
Do one of the following:
In the Compute Expression box, enter an expression to define the computed field.
Click the button to the right of the box to display the Modify Expression dialog box. In this dialog box, you can easily enter a complicated expression. When you have finished, you can verify it and click OK.
The Modify Expression dialog box provides you with lists and buttons to help you create the computed field:
The Modify Expression dialog box contains:
A Functions box with a list of built-in functions you can use in the computed field
A Columns box with a list of columns, named computed fields, and retrieval arguments in the form
Buttons for adding operators and parentheses
You can enter any valid expression when defining a computed field. You can paste operators, columns, existing computed fields, retrieval arguments, and functions into the expression from information in the Modify Expression dialog box. You can use the + operator to concatenate strings.
InfoMaker expression The expression you are entering is an InfoMaker expression; it is not a SQL expression processed by the DBMS. The expression follows InfoMaker rules. For complete information about expressions, see Chapter 23, “Operators and Expressions.”
Here are some examples of computed fields:
To display |
Enter this expression |
---|---|
Current date |
|
Current time |
|
Concatenation of Fname and Lname columns for each row |
|
Monthly salary if Salary column contains annual salary |
|
Four asterisks if the value of the Salary column is greater than $50,000 |
|
Average salary of all retrieved rows |
|
Count of retrieved rows, assuming each row contains a value for EmpID |
|
For more information about the functions you can use in computed fields in the Form painter, see Chapter 24, “DataWindow Expression and InfoMaker Functions” and online Help.