Sorting Criteria snippet
The Sorting Criteria snippet is a useful tool to organize and maintain the required sorting criteria field.
The SQL parameters snippet would be used in some AlchemyJ Extended Functions such as ajDBReadRecord.
To insert a Sorting Criteria snippet, select a cell in an empty row and ensure that there are 4 extra empty rows below it to prevent the snippet from overwriting the values below.
Go to AlchemyJ ribbon and click Insert Snippet. Under the dropdown, select Sorting Criteria.
|This column is to list down the data name.|
|The Sorting Order indicates the column to sort by. It is an integer which represents the column number from left to right. 1 means the first column, 5 means the 5th column. If omitted, it will default to sort by the primary key column in the table.|
|The Sorting Direction can be "ASC" or "DESC". If "ASC" is keyed in, the records would be sorted starting from A to Z. If "DESC" is keyed in, the records would be sorted starting from Z to A. If this field is empty, the default would be "ASC".|
Below is the example of the ajDBReadRecord function. Insert the Sorting Criteria snippet.
The snippet will be populated as shown below with no values.
Fill in the Sorting Criteria details accordingly.
When referencing the Sorting Criteria table, do remember to include the column headers as part of the cell range as shown in Cell B90 for the formula to work.