Skip to main content

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.

  1. Select Menus in the menu.

  2. Click the Add Item button in the list app bar.

  3. Type a title in the Title field.

  4. Click in the Query field to open the Table and Fields Designer.


Add a query
Figure 1 - Add a query

  1. Click the Add Table button.

Add a Table
Figure 2 - Add Table button

  1. Select a table.

Select Table Name
Figure 3 - Select table name

  1. Double click the field names required for the query.

  2. Type a condition in the Criteria field.


Add Fields and Criteria
Figure 4 - Add fields and criteria


Criteria Example

> 1000



info

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.



Result Set
Figure 5 - Result set


tip

When entering a string it is strongly recommended to use quotes '' around the value to clearly define that it is a string.


  1. Click the Save button in the Table and Fields Designer app bar.

Save the query
Figure 6 - Save the query

  1. Click the Fields tab.

Fields Tab
Figure 7 - Fields tab

  1. Click the Save button in the form app bar.

Save the form
Figure 8 - Save the form



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.


OperatorDescription
=EqualsSQL example
>Greater thanSQL example
<Less thanSQL example
>=Greater than or equalSQL example
<=Less than or equalSQL example
<>Not equalSQL example
BETWEENBetween a certain rangeSQL example
LIKESearch for a patternSQL example
INTo specify multiple possible values for a columnSQL example
NOT INTo specify values are not in a list of valuesSQL 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


OperatorExample
== 'Brisbane'
>> 4000
<< 4000
>=>= 4777
<=<= 4777
<><> 4777
BETWEENTo be implemented
LIKETo be implemented
INTo be implemented
NOT INTo be implemented