The DATEVAL function converts a nondate to a date field, for unambiguous use with date fields.
If the DATEPROC compiler option is in effect, the returned value is a date field containing the value of argument-1 unchanged. For information about using the resulting date field:
If the NODATEPROC compiler option is in effect, the DATEVAL function has no effect, and returns the value of argument-1 unchanged.
The function type depends on the type of argument-1:
| Argument type | Function type |
|---|---|
| Alphanumeric | Alphanumeric |
| Integer | Integer |
| Format |
|---|
|
The value of argument-1 represents a date of the form specified by argument-2.
| Date-pattern string | Specifies that argument-1 contains |
|---|---|
| YY | A windowed (two-digit) year |
| YYYY | An expanded (four-digit) year |
| X | A single character; for example, a digit representing a semester or quarter (1-4) |
| XX | Two characters; for example, digits representing a month (01-12) |
| XXX | Three characters; for example, digits representing a day of the year (001-366) |
| XXXX | Four characters; for example, two digits representing a month (01-12) and two digits representing a day of the month (01-31) |