# Logic to increment based on month

Need help here! How to iterate if month MM=06 then I need to type period as 1 in some application like… MM=07 then period will be 2 ,MM=08 then period will be 3 …, help appropriate here.

This will provide the current month as January = 1, June = 6, December = 12: `Now.ToString("M")`

If you want it as an integer, just do the same thing wrapped with CInt(): `CInt(Now.ToString("M"))`

My case is different here I will read month in MM format and after will check. If MM month is July then my period will be 1 , if MM August then my period will be 2 ‘month September then period 3 like that…
I need to increment period from July onwards

Use Switch conditions then @Deepika

Read the month and pass it to switch condition so that it will give the number based on your requirement

Sorry I misread. Will it always be the same pattern? so MM=07 and you want to return 1, MM=08, you want to return 2. Does that mean that June (MM=06) would be 12? If so then a simple If condition should be fine in your case.

``````Assign monthNum = Cint(Now.ToString("M")  //  This is an integer variable
If activity condition: monthNum >= 7
True side: Assign period = monthNum - 6
False side: Assign period = monthNum + 6``````