Add in month

From excel sheet ,i am reading month using assign(output is 2)
i want to add 1 in month(so that output becomes 3)

@Ananya1, Try this:

IF month = 12
ASSIGN: month = 1
ELSE
ASSIGN: month = month + 1

Assumption: I assume that DataType of the month variable is INT. If not, please use Convert.ToInt16(month)

Let me know if you need more detail.

Cheers

no its not working, since datatype i used is date

month will depend on what is current month
then we will add 1 in that

Then its even simpler, Try as follow:
dateVariable.AddMonths(1)

Cheers

1 Like