Skip to content

PERIOD_ADD

  • p: This is the period argument and it should be in the format YYMM or YYYYMM. It stands for the starting period to which we intend to add months.
  • n: This is the integer argument representing the number of periods to add to P. The added periods will be in months. For instance, if the value of N is 3, three months will be added to the period P.
SELECT PERIOD_ADD(202102,3);
202105

The PERIOD_ADD function in MySQL is used for adding a specified number of months to a period. In the given example, the function is adding ‘3’ months to ‘202102’, resulting in ‘202105’.