Check if current date is within first to 15th of the current month

Hi @dutta.marina

Try this.

If currentDate.Day >= 1 And currentDate.Day <= 15 Then
Get the last date of the previous month
resultDate = New DateTime(currentDate.Year, currentDate.Month, 1).AddDays(-1)
Else
Use the current date
resultDate = currentDate
End If

1 Like