How can I put a condition to check whether the particular date falls between 1st to 5th day of the month or it falls between 6th day of month to last date of month .
for example if the current Month is August , I need to check if the date range falls between 1st August to 5th August or the particular date falls between 6th August to 31st August.
If isFirstRange Then
Log Message: “Date falls between 1st to 5th day of the month.”
ElseIf isSecondRange Then
Log Message: “Date falls from 6th day to the end of the month.”
Else
Log Message: “Date does not fall within the specified ranges.”
End If
Assign:
currentDate = Now (DataType: System.DateTime)
dayOfMonth = currentDate.Day (DataType: System.Int32)
If:
Condition: dayOfMonth >= 1 AndAlso dayOfMonth <= 5
Then:
Log Message: "Date falls between 1st and 5th day of the month."
Else If:
Condition: dayOfMonth >= 6 AndAlso dayOfMonth <= DateTime.DaysInMonth(currentDate.Year, currentDate.Month)
Then:
Log Message: "Date falls between 6th day and last day of the month."
Else:
Log Message: "Date does not fall within the specified ranges."
Refer the xaml file for better understanding. Sequence30.xaml (9.9 KB)
Assign:
day = currentDate.Day
month = currentDate.Month
If:
Condition: day >= 1 And day <= 5
Then:
Log Message: “Date falls between 1st and 5th”
Else:
Condition: day >= 6 And day <= DateTime.DaysInMonth(currentDate.Year, month)
Then:
Log Message: “Date falls between 6th and last day”
=> Assign -> currentDate (System.DateTime datatype) = Now
=> Assign -> day (int datatype) = currentDate.Day
=> If (day >= 1 AND day <= 5)
In then block give the log message "Date is in between 1st to 5th day range"
Else If (day >= 6 AND day <= DateTime.DaysInMonth(currentDate.Year, currentDate.Month)):
In else block give the log message "Date is after 6th to end day of the month"