Date# - script and chart function
Date# converts a text string to a numerical date by applying the provided date format pattern, or if omitted by the default date format pattern.
Syntax:
Date#(text[, format])
Return data type: dual
Arguments:
Argument | Description |
---|---|
text |
The text string to be evaluated. |
format | String describing how the resulting date string is to be formatted. If omitted, the date format set in the operating system is used. |
Example:
The following example uses the date format M/D/YYYY. The date format is specified in the SET DateFormat statement at the top of the data load script.
Add this example script to your app and run it.
Load *,
Num(Date#(StringDate)) as Date;
LOAD * INLINE [
StringDate
8/7/97
8/6/1997
];
If you create a table with StringDate and Date as dimensions, the results are as follows:
StringDate | Date |
---|---|
8/7/97 | 35649 |
8/6/1997 | 35648 |