Check week In Between of a month

Hello Everyone,

How can we check based of present date if week is between of a month

If date is Not first week of a month Or last week of Month

Then Print Log message as True(Week in Between)

Hi @anmita

Try this:

Assign: currentDate = DateTime.Now
 If (Condition: currentDate.Day > 7 And currentDate.Day <= DateTime.DaysInMonth(currentDate.Year, currentDate.Month) - 7)
    Log Message: "True (Week in Between)"
    Log Message: "False (First or Last Week)"

Hope it helps!!

Thanks @Parvathy for the quick response

1 Like


Boolean variable isWeekInBetween

isWeekInBetween=DateTime.Now.Day > 7 And DateTime.Now.Day <= (DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month) - 7)

Hello @anmita


Assign Name="isInFirstWeek" Value="[Your Condition for First Week]"
Assign Name="isInLastWeek" Value="[Your Condition for Last Week]"
If Condition="Not isInFirstWeek And Not isInLastWeek"
    LogMessage Text="True (Week in Between)" 

Replace [Your Condition for First Week] and [Your Condition for Last Week] with the actual conditions to check if the current date is in the first or last week of the month. If neither condition is met, the log message “True (Week in Between)” will be printed.

Thanks & Cheers!!!

Hi @anmita

if( >7 AndAlso Now.Day<=DateTime.DaysInMonth(Now.Year, Now.Month) - 7,“T”,“F”)

Try this

Hi @anmita ,

Could also maybe check with the below :

Now.Day>7 andAlso Now.Day<Now.AddDays(