Sort Results
Last updated 8/04/2022
Sort the Returned Result Set
By default your records will be returned in the order they are positioned in your tables in the database. In Five, you can select to have the records in Ascending, Descending, or no order.
Ascending order will return:
- Lowest to highest for a numeric field.
- Earliest to latest for a date or time field.
- A to Z for a text field.
Descending order will return:
- Highest to lowest for a numeric field.
- Latest to earliest for a date or time field.
- Z to A for a text field.
Sort by Ascending Order
Prerequisite
Give your query a title and open the Table and Fields Designer.
Steps
- Click the Add Table button.
- Select a table.
Click outside of the Table Selector dialog box to close the window.
Select the table and drag to the desired position on the Designer.
Double click the field names required for the query.
In the field you want to sort by, click the lookup icon in the Sort field and select Ascending.
Sort by Descending Order
Prerequisite
Give your query a title and open the Table and Fields Designer.
Steps
- Click the Add Table button.
- Select a table.
Click outside of the Table Selector dialog box to close the window.
Select the table and drag to the desired position on the Designer.
Double click the field names required for the query.
In the field you want to sort by, click the lookup icon in the Sort field and select Descending.
Sort by Multiple Fields.
At the time of this documentation, CONCAT
is not supported in the Table and Fields Designer. The following is a scenario in which you can order by two fields. If we were to sort
by the first name and then the last name. Five would first sort by the first field and then the second field.
Example
First Name | Last Name |
---|---|
Greg | Anderson |
Beth | Keely |
Beth | Appleby |
Beth | Zenith |
If you select to order both the First Name and the Last Name fields in ascending order the results would be:
First Name | Last Name |
---|---|
Beth | Appleby |
Beth | Keely |
Beth | Zenith |
Greg | Anderson |
Steps
- Click the Add Table button.
- Select a table.
Click outside of the Table Selector dialog box to close the window.
Select the table and drag to the desired position on the Designer.
Double click the field names required for the query.
In first field you want to sort by, click the lookup icon in the Sort field and select Ascending or Descending.
In first field you want to sort by, click the lookup icon in the Sort field and select Ascending or Descending.
Remove Ascending/Descending Sorting
- Click the lookup icon in the Sort field.
- Select None.
tip
Your, query, query fields, and form need to be saved.