![]() Previous |
![]() Next |
A valid input literal value of type DATE must conform to one of three styles: numeric, packed numeric, or month name. You can mix these styles throughout a session.
Tip: To determine whether a text expression (such as an expression with a data type of TEXT or ID) represents a valid DATE-only value, use the ISDATE program |
Numeric style
Specify the day, month, and year as three INTEGER
values with one or more separators between them, using these rules:
The day and month components can have one digit or two digits.
For any year, the year component can have four digits (for example, 1997). For years in the range 1950 to 2049, the year component can, alternatively, have two digits (50 represents 1950, and so on).
To separate the components, you can use a space, dash (-
), slash (/
), colon (:
), or comma (,
).
Examples: '24/4/97'
or '24-04-1997'
Packed numeric style
Specify the day, month, and year as three INTEGER
values with no separators between them, using these rules:
The day and month components must have two digits. When the day or month is less than 10, it must be preceded by a zero.
For any year, the year component can have four digits (for example, 1997). For years in the range 1950 to 2049, the year component can, alternatively, have two digits (50 represents 1950, and so on).
You cannot use any separators between the date components.
Examples: '240497'
or '04241997'
Month name style
Specify the day and year as INTEGER
values and the month as text, using these rules:
The month component must match one name listed in the MONTHNAMES option. You can abbreviate the month name to one letter or more, when you supply enough letters to uniquely match the beginning of a name in MONTHNAMES. The case of the letters in the month component (uppercase or lowercase) does not need to match the case in MONTHNAMES.
The day component can have one digit or two digits.
For any year, the year component can have four digits (for example, 1997). For years in the range 1950 to 2049, the year component can, alternatively, have two digits (50 represents 1950, and so on).
When the day and year components are adjacent, they must have at least one separator between them. As separators, you can use a space, dash (-
), slash (/
), colon (:
), or comma (,
). When you want, you can place one or more separators between the day and month or between the year and month.
Examples: '24APR97'
or '24 ap 97'
or 'April 24, 1997'