DATE type using format.
Syntax
Parameters
Accepted
<format> patterns include the following specifications:
Usage notes for formatting
- Case letters in the input
<expression>are ignored - A separator (non-digit and non-letter) in the
<format>string will match exactly one separator or is skipped - Any non-separator in the
<format>that is not part of a format option will match exactly one other character. - Any character in quotes
"will match exactly one other character. - If the year format specification is
'YYY','YY', or'Y'and the supplied year is less than four digits, the year will be adjusted to be nearest to the year 2020, (e.g.,80becomes1980). - More specification, such as
'HH','MI', or,'TZH', are accepted but ignored for purposes of computing theDATEresult. - Modifiers (e.g.,
'FM') are not supported.
FF1, FF2, FF3, FF4, FF5, FF6, SSSS, SSSSS, IYYY, IYY, IY, I, BC, AD, B_DOT_C_DOT, A_DOT_D_DOT, DAY, DY, DDD, IDDD, D, ID, W, WW, IW, CC, J, Q.
Using them in the format string raises an error.
Return Type
DATE
Examples
The following example shows that separators and non-separators can cause skips. The separator' ' (space) in the <format> matches the other separator '/' in the <expression>. The non-separator 'x' will match any other character, in this case the 'a'. Lastly, the two separators '++' will match up to two other separators, here the first 'x' matches '.' while the second 'x' will simply be ignored as no other separators follow.
Rows: 1Execution time: 5.07ms
YYY was used to match a number that contains less than four digits. To receive the exact year '180' use YYYY instead.
Furthermore, as the three separators are quotes "..." they will match any character (separator or non-separator) which in this case is 'ar '.
Rows: 1Execution time: 7.32ms