EXTEND()

The EXTEND() operator adjusts a date time value according to the qualifier.

Syntax

EXTEND ( dt-expr, qual1 TO qual2 [(scale)])
  1. dt-expr is a date / time expression.
  2. qual1, qual2 and scale define the date time qualifier.

Usage

The EXTEND() operator is used to convert a date time expression to a DATETIME value with a different precision.

The default qualifier is YEAR TO DAY.

The possible qualifiers are the same as in a DATETIME data type definition.

The expressions passed as first parameter must be a valid datetime value. If it is a character string, it must consist of valid and unambiguous time-unit values and separators, but with these restrictions:

Example

MAIN
  DISPLAY EXTEND ( TODAY, YEAR TO FRACTION(4) )
END MAIN