Increment a specified period by a given number of months.
SELECT PERIOD_ADD(201703, 5); |
The PERIOD_ADD() function increments a specified period by a given number of months.
Note: The PERIOD_ADD() function returns the result formatted as YYYYMM after adding a specified number of months to a period.
PERIOD_ADD(period, number) |
Parameter |
Description |
period |
Mandatory: A period in the format YYMM or YYYYMM |
number |
Mandatory: Specifies the number of months to add to the period. Positive and negative values are both acceptable. |
Works in: |
From MySQL version 4.0 |
Increase or decrease a period by a specified number of months.
SELECT PERIOD_ADD(201703, 15); |
Adjust a specified period by adding or subtracting a specified number of months.
SELECT PERIOD_ADD(201703, –2); |