1.1.11 Date
Date is a fixed-length field with a length of 10, containing a date in ISO format: YYYY-MM-DD. The *NULL value is 1900-01-01, as this value is valid across all supported databases.
Please review the general 1.1.1 Field Type Considerations.
Field Definition Rules
Rules for defining a Date field in the repository are:
Length | Dates must be 10 in length. Dates have no decimals. |
|---|---|
Valid Keyboard Shift | Blanks |
Allowed Attributes | AB, ASQN, CYDC, CYDU, CYDX, CS, FE, ISO, ND, RA, RL, RLTB. |
Edit Mask | Not allowed. |
Default | *SQLNULL. ASQN will be enabled by default. |
Field Definition Notes
- By default, Dates are ISO format.
Usage Rules
Partition Type | |
|---|---|
Files | Dates may only be used in RDMLX Files. Dates may be used as real fields or keys. If used as key fields, take note of the Warning below. |
Logical Views | Dates may be used as keys to logical views. |
Virtual Fields | Dates may be used with Date Virtual Fields as the source field. |
Predetermined Join Fields | Not allowed. |
RDML Commands | Dates are classified as their own types and are not valid for numeric or alpha command parameters in RDML commands. |
Built-In Functions | When used in Built-In Functions, Dates are classified as their own type (D) and are not valid for numeric or alpha arguments. |
Special Values | *NULL, *HIVAL, *LOVAL, *REMEMBERED_VALUE |
Conversion | Date fields may be converted to alpha, signed, packed, string or char. Refer to Field Type Conversions . |
Usage Notes
- Working fields may be defined as TYPE(*DATE). Date literals are always specified in ISO format, for example: 20030331.
- Dates can be used in Datecheck validation rules.
Warnings
- If this field is used as a key field, remove the *SQLNULL and ASQN attributes.
Platform Considerations
- Refer to Platform Considerations in 1.1.1 Field Type Considerations.
Tips & Techniques
- To use a Date field, #MyDate, as an alpha argument, you simply use #MyDate.asString, explicitly stating that you want to use the string representation.