Editing Criteria
Click on Add or Edit on the Insert DB Loop window to display the Add / Update Criteria window. |
Use this window to add or update a criteria clause in your database LOOP command. Make the required changes and when you press Update the criteria list on the LOOP window. The window can effectively be split into three sections (from left to right).
You must press Add New (or Update if editing an existing criteria) for your changes to be applied to the current LOOP you are editing.
To learn more about the features of this window, glance down the table below or highlight the control you are interested in by clicking on the screenshot above.
Section 1
Check the Variable option if you want to use a variable instead of a field. The window will change to look like this: |
Select the variable you want to use from the drop-down list or press Expression to display the Expression Editor. |
Section 2
Section 3
The Current row option is only enabled if you are inside an embedded LOOP. In other words, this loop is inside an outer LOOP. If this is the case, the row that is currently being accessed in the outer LOOP is termed the Current Row, so you can access this information when narrowing down your records.
When this option is on you will see a list of available fields from the outer LOOP.
Set the Variable option if you want to use a variable in the where clause. When this option is on, you can choose a variable from those available in the drop-down list. This makes the LOOP command very powerful.
Read up on the REQUIRES command if you are not sure about variables.
If you want to use an expression to represent the value to compare against then press Expression to display the Expression Editor.
Working with Date Fields
Please be aware about how it works for date fields. When you first select a date field from the drop-down list on the left, the control on the right is a standard date picker.
If you want to compare with the result of an expression, click the Expression button on the right. When you close the Expression Editor by pressing OK then date picker will be replaced by a normal text box, as if we were comparing against a string - the expression will be entered into this box.
If you accept this criteria and then edit it later, it will note that it is an expression and automatically bring back the expression and text box instead of the date picker.
If you subsequently select any date field from the drop-down list on the left - including re-selecting the same date field - the text box will revert to the date picker. This is how you can revert to a simple date.
To avoid losing your expression, don't change the field drop list on the left while an expression is showing on the right.