Notice: session_start(): A session had already been started - ignoring in /home/u614325693/domains/onedoubt.com/public_html/post.php on line 3
PERIOD_ADD - ONEDOUBT.COM

Example

Add a specified number of months to a period:

SELECT PERIOD_ADD(201703, 5);

Definition and Usage

The PERIOD_ADD() function adds a specified number of months to a period.

The PERIOD_ADD() function will return the result formatted as YYYYMM.

Syntax

PERIOD_ADD(period, number)

Parameter Values

Parameter Description
period Required. A period. Format: YYMM or YYYYMM
number Required. The number of months to add to period. Both positive and negative values are allowed

Technical Details

Works in: From MySQL 4.0

More Examples

Example

Add a specified number of months to a period:

SELECT PERIOD_ADD(201703, 15);

Example

Add a specified number of months to a period:

SELECT PERIOD_ADD(201703, -2);


Login
ADS CODE