Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to add months to YYYYMM format

Hello everyone,

I have the following date format: YYYYMM. I would like to add a month to this format,

but it doesnt seem to work correctly.

for example, if I have a date 201201, the new value must be 201202.

If I have a date 201212, the new value must be 201301.

Help will be appreciated.

Thanks,

Stefan

6 Replies
Anonymous
Not applicable
Author

use this expression

addmonths(date#(yourdates,'YYYYMM',1)

sunny_talwar

and to format is again as YYYYMM, you can use Date() function

Date(AddMonths(Date#(yourdates,'YYYYMM',1), 'YYYYMM')

Not applicable
Author

=Date(MonthEnd(Date#(YourValue, 'YYYYMM'))+1, 'YYYYMM')

nareshthavidishetty
Creator III
Creator III

Not getting the required format.

Thanks..

olivierrobin
Specialist III
Specialist III

maybe that

let m=201212;

let m1=date(AddMonths(date#(m*100+1,'YYYYMMDD'),1),'YYYYMM');

sunny_talwar

Thanks for providing this information