Code for the if condition outside the while loop
DateTime.ParseExact(startDate, “dd-MMM”, System.Globalization.CultureInfo.InvariantCulture) <= DateTime.ParseExact(endDate, “dd-MMM”, System.Globalization.CultureInfo.InvariantCulture)
startDate = first day of the current month
endDate = last day of the current month
Hello, I am having trouble making a loop based on dates, currently only have columns April first to ninth available but my bot is supposed to loop through the first day of the current month till the last day of the current month.
So far the bot manages to enter the While loop which is just merely startDate <= endDate, then there is a counter that starts at 1 and will only +1 if it’s <=30 due to days in a month which I have minimized, here comes the problem.
The LookUp Range input value which is
new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddDays(counter).ToString(“dd-MMM”) is not returning anything and I am just confused as to why it returns blank…
My plan here was to use the counter within AddDays to make the lookup range dynamic output so I can loop through the dates.
Sorry for the wall of text and any help will be greatly appreciated