Add Criteria
Last updated 6/04/2022
Add a Query Field with a Criteria Condition
The Criteria field is used to filter records. It is used to extract only those records that meet a specified condition. These criteria conditions can be connected through AND and OR conditions. The Criteria field must be used with a selected field.
Select Menus in the menu.
Click the Add Item button in the list app bar.
Type a title in the Title field.
Click in the Query field to open the Table and Fields Designer.
- Click the Add Table button.
- Select a table.
Double click the field names required for the query.
Type a condition in the Criteria field.
> 1000
This WHERE
statement will return all patients with a patient number greater than 1000. Because the first name and last name fields are included in the query, these are also included in the result set.
When entering a string it is strongly recommended to use quotes ''
around the value to clearly define that it is a string.
- Click the Save button in the Table and Fields Designer app bar.
- Click the Fields tab.
- Click the Save button in the form app bar.
When using critieria for more than one field in the row, Five will create an AND condition. The records will be returned when all the criterias are met.
When using more than one criteria in multiple columns, Five will create an OR condition. The records will be returned when any one of the criterias are met.
Operators in the Criteria
The following operators can be used in the Criteria field.
Operator | Description | |
---|---|---|
= | Equals | SQL example |
> | Greater than | SQL example |
< | Less than | SQL example |
>= | Greater than or equal | SQL example |
<= | Less than or equal | SQL example |
<> | Not equal | SQL example |
BETWEEN | Between a certain range | SQL example |
LIKE | Search for a pattern | SQL example |
IN | To specify multiple possible values for a column | SQL example |
NOT IN | To specify values are not in a list of values | SQL example |
In Five, you do not need to write the full SQL syntax in the Criteria field.
Examples of How to Write Conditions in the Criteria Field
Operator | Example |
---|---|
= | = 'Brisbane' |
> | > 4000 |
< | < 4000 |
>= | >= 4777 |
<= | <= 4777 |
<> | <> 4777 |
BETWEEN | To be implemented |
LIKE | To be implemented |
IN | To be implemented |
NOT IN | To be implemented |