DriveWorks Pro 17: 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

Culture Codes

The table below gives an example of some of the more common Culture Codes.

For a more comprehensive list use your Internet search engine to search the term .net framework culture code.

English Name Culture Code Short Date Format Long Date Format
Afrikaans (South Africa) af-ZA yyyy/MM/dd dd MMMM yyyy
Alsatian (France) gsw-FR dd/MM/yyyy dddd d MMMM yyyy
Arabic (Egypt) ar-EG dd/MM/yyyy dd MMMM, yyyy
Arabic (Saudi Arabia) ar-SA dd/MM/yy dd/MMMM/yyyy
Arabic (Tunisia) ar-TN dd-MM-yyyy dd MMMM, yyyy
Assamese (India) as-IN dd-MM-yyyy yyyy,MMMM dd, dddd
Basque (Basque) eu-ES yyyy/MM/dd dddd, yyyy'(e)ko' MMMM'ren' d'a'
Breton (France) br-FR dd/MM/yyyy dddd d MMMM yyyy
Bulgarian (Bulgaria) bg-BG d.M.yyyy 'г.' dd MMMM yyyy 'г.'
Catalan (Catalan) ca-ES dd/MM/yyyy dddd, d MMMM' de 'yyyy
Chinese (Simplified, China) zh-CN yyyy/M/d yyyy'年'M'月'd'日'
Chinese (Simplified, Singapore) zh-SG d/M/yyyy yyyy'年'M'月'd'日'
Chinese (Traditional, Hong Kong SAR) zh-HK d/M/yyyy yyyy'年'M'月'd'日'
Chinese (Traditional, Macao SAR) zh-MO d/M/yyyy yyyy'年'M'月'd'日'
Chinese (Traditional, Taiwan) zh-TW yyyy/M/d yyyy'年'M'月'd'日'
Corsican (France) co-FR dd/MM/yyyy dddd d MMMM yyyy
Croatian (Croatia) hr-HR d.M.yyyy. d. MMMM yyyy.
Croatian (Latin, Bosnia and Herzegovina) hr-BA d.M.yyyy. d. MMMM yyyy.
Czech (Czech Republic) cs-CZ d. M. yyyy d. MMMM yyyy
Danish (Denmark) da-DK dd-MM-yyyy d. MMMM yyyy
Dutch (Belgium) nl-BE d/MM/yyyy dddd d MMMM yyyy
Dutch (Netherlands) nl-NL d-M-yyyy dddd d MMMM yyyy
English (Australia) en-AU d/MM/yyyy dddd, d MMMM yyyy
English (Belize) en-BZ dd/MM/yyyy dddd, dd MMMM yyyy
English (Canada) en-CA yyyy-MM-dd MMMM d, yyyy
English (Caribbean) en-029 dd/MM/yyyy dddd, dd MMMM yyyy
English (Hong Kong) en-HK d/M/yy dddd, d MMMM, yyyy
English (India) en-IN dd-MM-yyyy dd MMMM yyyy
English (Ireland) en-IE dd/MM/yyyy dd MMMM yyyy
English (Malaysia) en-MY d/M/yyyy dddd, d MMMM, yyyy
English (New Zealand) en-NZ d/MM/yyyy dddd, d MMMM yyyy
English (Singapore) en-SG d/M/yyyy dddd, d MMMM yyyy
English (South Africa) en-ZA yyyy-MM-dd dd MMMM yyyy
English (United Kingdom) en-GB dd/MM/yyyy dd MMMM yyyy
English (United States) en-US M/d/yyyy dddd, MMMM d, yyyy
Finnish (Finland) fi-FI d.M.yyyy d. MMMM yyyy
French (Belgium) fr-BE dd-MM-yy dddd d MMMM yyyy
French (Canada) fr-CA yyyy-MM-dd d MMMM yyyy
French (France) fr-FR dd/MM/yyyy dddd d MMMM yyyy
French (Luxembourg) fr-LU dd/MM/yyyy dddd', le 'd MMMM yyyy
French (Monaco) fr-MC dd/MM/yyyy dddd d MMMM yyyy
French (Morocco) fr-MA dd/MM/yyyy dddd d MMMM yyyy
French (Switzerland) fr-CH dd.MM.yyyy dddd d MMMM yyyy
Frisian (Netherlands) fy-NL d-M-yyyy dddd d MMMM yyyy
German (Austria) de-AT dd.MM.yyyy dddd, dd. MMMM yyyy
German (Germany) de-DE dd.MM.yyyy dddd, d. MMMM yyyy
German (Luxembourg) de-LU dd.MM.yyyy dddd' den 'd'.' MMMM yyyy
German (Switzerland) de-CH dd.MM.yyyy dddd, d. MMMM yyyy
Greek (Greece) el-GR d/M/yyyy dddd, d MMMM yyyy
Gujarati (India) gu-IN dd-MM-yy dd MMMM yyyy
Hebrew (Israel) he-IL dd/MM/yyyy dddd dd MMMM yyyy
Hindi (India) hi-IN dd-MM-yyyy dd MMMM yyyy
Hungarian (Hungary) hu-HU yyyy.MM.dd. yyyy. MMMM d.
Icelandic (Iceland) is-IS d.M.yyyy d. MMMM yyyy
Irish (Ireland) ga-IE dd/MM/yyyy d MMMM yyyy
Italian (Italy) it-IT dd/MM/yyyy dddd d MMMM yyyy
Italian (Switzerland) it-CH dd.MM.yyyy dddd, d. MMMM yyyy
Japanese (Japan) ja-JP yyyy/MM/dd yyyy'年'M'月'd'日'
Luxembourgish (Luxembourg) lb-LU dd.MM.yy d. MMMM yyyy
Nepali (India) ne-IN yyyy-MM-dd yyyy MMMM d, dddd
Nepali (Nepal) ne-NP M/d/yyyy dddd, MMMM dd, yyyy
Norwegian, Bokmål (Norway) nb-NO dd.MM.yyyy d. MMMM yyyy
Norwegian, Nynorsk (Norway) nn-NO dd.MM.yyyy d. MMMM yyyy
Polish (Poland) pl-PL yyyy-MM-dd d MMMM yyyy
Portuguese (Brazil) pt-BR dd/MM/yyyy dddd, d' de 'MMMM' de 'yyyy
Portuguese (Portugal) pt-PT dd/MM/yyyy d' de 'MMMM' de 'yyyy
Punjabi (India) pa-IN dd-MM-yy dd MMMM yyyy dddd
Russian (Russia) ru-RU dd.MM.yyyy d MMMM yyyy 'г.'
Slovenian (Slovenia) sl-SI d.M.yyyy d. MMMM yyyy
Spanish (Argentina) es-AR dd/MM/yyyy dddd, dd' de 'MMMM' de 'yyyy
Spanish (Bolivia) es-BO dd/MM/yyyy dddd, dd' de 'MMMM' de 'yyyy
Spanish (Chile) es-CL dd-MM-yyyy dddd, dd' de 'MMMM' de 'yyyy
Spanish (Colombia) es-CO dd/MM/yyyy dddd, dd' de 'MMMM' de 'yyyy
Spanish (Latin America) es-419 dd/MM/yy dddd, d 'de' MMMM 'de' yyyy
Spanish (Mexico) es-MX dd/MM/yyyy dddd, d' de 'MMMM' de 'yyyy
Spanish (Spain, International Sort) es-ES dd/MM/yyyy dddd, d' de 'MMMM' de 'yyyy
Spanish (United States) es-US M/d/yyyy dddd, MMMM dd, yyyy
Swedish (Finland) sv-FI d.M.yyyy 'den 'd MMMM yyyy
Swedish (Sweden) sv-SE yyyy-MM-dd 'den 'd MMMM yyyy
Thai (Thailand) th-TH d/M/yyyy d MMMM yyyy
Valencian (Spain) ca-ES-valencia dd/MM/yy dddd, d MMMM' del 'yyyy
Welsh (United Kingdom) cy-GB dd/MM/yy d MMMM yyyy

See also

How To: Work With Arrays

Table of Contents