Hello Team
If this month"s first day of month is a Monday
Then
Extract Last month last week
Monday to Sunday
Example today would have been jan 1st i.e Monday 2024
Then Calculate
25th Monday to 31st Dec Sunday 2023
Else if
Today is 4th March
This Month first day is Not a Monday
Then Extract
Last month
Last Monday to last day of the month
26th to 29th Feb
This month first day till first Sunday of the month
1st till 3rd Feb 2024
Thanks in advance
sanjay3
(Sanjay)
2
Hi @NISHITHA
as what I understand from the question the solution is
Sequence
Assign → currentDate = DateTime.Now.Date
Assign → isFirstDayMonday = (currentDate.DayOfWeek = DayOfWeek.Monday And currentDate.Day = 1)
If (isFirstDayMonday)
Assign → startDate = GetLastWeekMonday(DateTime.Now.AddMonths(-1))
Assign → endDate = GetLastWeekSunday(DateTime.Now.AddMonths(-1))
Else
Assign → startDate = GetLastMondayOfMonth(DateTime.Now.AddMonths(-1))
Assign → endDate = DateTime.DaysInMonth(DateTime.Now.AddMonths(-1).Year, DateTime.Now.AddMonths(-1).Month)
system
(system)
Closed
3
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.