PERIOD_ADD()

Overview

Adds a number of months to a starting period and returns the result.

USAGE

PERIOD_ADD(period, count)

Argument Name

Description

period

The starting period of time

months

The number of months to add

DETAILS

PERIOD_ADD() is a date-time function that adds a number of months to a starting period and returns the result.

The period argument must be in the format YYYYMM or YYMM.

The return value is a period in the format YYYYMM.

A NULL is returned if any argument is NULL.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT PERIOD_ADD(202006, 2),
       PERIOD_ADD(2006, 2);
+-----------------------+---------------------+
| PERIOD_ADD(202006, 2) | PERIOD_ADD(2006, 2) |
+-----------------------+---------------------+
|                202008 |              202008 |
+-----------------------+---------------------+
SELECT PERIOD_ADD(199702, 14),
       PERIOD_ADD(9702, 14);
+------------------------+----------------------+
| PERIOD_ADD(199702, 14) | PERIOD_ADD(9702, 14) |
+------------------------+----------------------+
|                 199804 |               199804 |
+------------------------+----------------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES