Hi Team,
I need to get all dates from previous month in the format “MM/dd/yyyy” and write same into excel
Hi Team,
I need to get all dates from previous month in the format “MM/dd/yyyy” and write same into excel
Hi
We can use DateTime.DaysInMonth method for this
The sequence of activities will be like
—use a assign activity like this
Int_days = DateTime.DaysinMonth(Cint(Now.Year),Cint(Now.Addmonths(-1).ToString(“MM”))
Where int_days is a variable of type int32 defined in the variable panel
—now use a WHILE LOOP activity like this
Counter < int_days
Where counter is a int32 variable defined in the variable panel with default value as 1
—now inside the loop use a WRITELINE activity like this
Now.AddMonths.ToString(“MM/dd/yyyy”)
—followed by this assign activity inside the while loop use a assign activity
counter = counter + 1
So this will display all the dates in the previous month
Cheers @sshitol
This was the correct solution to a similar endeavor I needed help with. Thank You!