Month condition

Hi

Hope this helps

Use a assign activity before this if condition like this

currentMonth = DateTime.Now.Month
Where currentMonth is a variable of type int32

Now in if condition

If currentMonth >= 1 AndAlso currentMonth <= 11 Then
    ' Month is between Jan and Nov
    ' Calculate the date for 31st March of (X+1) year
    resultDate = New DateTime(currentDate.Year + 1, 3, 31)
Else
    ' Month is Dec
    ' Calculate the date for 31st March of (X+2) year
    resultDate = New DateTime(currentDate.Year + 2, 3, 31)
End

resultDate variable should have a DateTime

Cheers @Karunamurthy

1 Like