NEXT_YEAR scalar function

The NEXT_YEAR function returns the first day of the year follows the year containing the date specified by the input.

Read syntax diagramSkip visual syntax diagramNEXT_YEAR(datetime-expression )

The schema is SYSIBM.

datetime-expression
An expression that specifies a date after which first day of the next year is to be returned. The expression must return a value that is a DATE, a TIMESTAMP, a CHAR, or a VARCHAR data type. In a Unicode database, the expression can also be a GRAPHIC or VARGRAPHIC data type. CHAR, VARCHAR, GRAPHIC, and VARGRAPHIC are supported using implicit casting. If datetime-expression is a CHAR, VARCHAR, GRAPHIC, or VARGRAPHIC data type, it must be a valid string accepted by the TIMESTAMP scalar function.

The result of the function is DATE. If the argument can be null, the result can be null. If the argument is null, the result is the null value.

Example

Returns the date value of the first day of the year that follows the year containing the date specified by the input.
values next_year('2007-02-18')
      Result: 2008-01-01