Labeled Duration

Restriction: This topic applies to Windows environments only.

This type of duration represents a specific unit of time as expressed by a number followed by one of the following keywords:

YEAR YEARS
MONTH MONTHS
DAY DAYS
HOUR HOURS
MINUTE MINUTES
SECOND SECONDS
MICROSECOND MICROSECONDS

The value of the labeled duration can be the result of an expression. It is treated as a DECIMAL(15,0) number. To use a labeled duration in a date-time computation, the other arithmetic operator must be a DATE, TIME or TIMESTAMP data field. Consider the following expression examples where ORDERDATE is a date field being added to two labeled durations (2 MONTHS and 14 DAYS).

ORDERDATE + 2 MONTHS + 14 DAYS
This is a valid entry because the expression is resolved from left to right, with ORDERDATE + 2 MONTHS yielding a DATE. The labeled duration 14 DAYS is then added to the new DATE. This expression is the same as (ORDERDATE + 2 MONTHS) + 14 DAYS.
ORDERDATE + (2 MONTHS + 14 DAYS)
This is not a valid entry because a labeled duration cannot be added to another labeled duration (2 MONTHS cannot be added to 14 DAYS).