DriveWorks Solo 16: TableSortByDate [send feedback...]

TableSortByDate

Performs a sort on the specified column of the given table by date. The data is assumed to be in the en-US format if the culture parameter is omitted.

Syntax

TableSortByDate(Table or Table Name, Column Index, Has Headers, Sort Ascending, Culture)

Where:

Table or Table Name is a Table array (such as the data in a standard table, or the result of a QueryDataValues function).

Column is the column on which to base the sort. Number starting at 1 for the first column.

Has Headers is TRUE will treat the first row as headers (therefore exclude from the sort). FALSE will sort the entire table (including the first row).

Sort Ascending is TRUE to sort in ascending order, FALSE to sort in descending order.

Culture (optional) is the culture code for the date format (for example fr-FR).

Examples

RuleMeaning
TableSortByDate(DwTableSpecificationsMade,4,True,True,"en-US")Will sort all data on the fourth column of the given table.

Example Data

The following table (DwTableSpecificationsMade)is the table required to perform the TableSortByDate on:

IDState NameProject NameDate
1SpecifyDefault01/14/2018
2PendingDefault07/20/2018
3CompletedDefault08/21/2018
4Released To ServerDefault04/17/2018
5SavedDefault05/18/2018
6SpecifyProject106/19/2018
7SavedProject102/15/2018
8Awaiting ReviewProject103/16/2018
9Changes RequestedProject109/22/2018

Data Returned As Array

The above data will be returned as an array as follows:

{"ID", "State Name", "Project Name", "Date"; "1", "Specify", "Default", "01/14/2018"; "7", "Saved", "Project1", "02/15/2018"; "8", "Awaiting Review", "Project1", "03/16/2018"; "4", "Released To Server", "Default", "04/17/2018"; "5", "Saved", "Default", "05/18/2018"; "6", "Specify", "Project1", "06/19/2018"; "2", "Pending", "Default", "07/20/2018"; "3", "Completed", "Default", "08/21/2018"; "9", "Changes Requested", "Project1", "09/22/2018"}

Array Expressed in a Table (such as a Data Table control)

IDState NameProject NameDate
1SpecifyDefault01/14/2018
7SavedProject102/15/2018
8Awaiting ReviewProject103/16/2018
4Released To ServerDefault04/17/2018
5SavedDefault05/18/2018
6SpecifyProject106/19/2018
2PendingDefault07/20/2018
3CompletedDefault08/21/2018
9Changes RequestedProject109/22/2018


See also

How To: Work With Arrays

Table of Contents