Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in RPA by (5.3k points)

I'm attempting to output all days within the current week. e.g. for this week, show all days, 05/12/2019 through 05/18/2019 only. when the bot is executed next week, only show days 05/19/2019 through 05/25/2019. My current logic outputs the days for this week, but come tomorrow, the dates for this week will be thrown off. Please see the following

enter image description here

...could I get some help with this please?

1 Answer

0 votes
by (9.5k points)

I will suggest you to do this using a VBS script, using Run Script command.

The default week start is Sunday you can change it check: https://www.w3schools.com/asp/func_weekday.asp

Pass the day you that you want as a parameter from 0 to 6, and get the data as a return value.

DayNumber: 0 = Sunday ..... 6 = Saturday

InputDate = Date DayNumber = WScript.Arguments.Item(0) Result = DateAdd("d", DayNumber - WeekDay(InputDate, 2), InputDate) WScript.StdOut.Write(Result) 'MsgBox(Result)

Browse Categories

...