Visual Basic code for multiple days of the week


#1

I am trying to automate a process where Tuesday I run a SAP report with certain parameters and Wed-Fri I run the same report with different parameters. I will be creating a “If” activity for Tuesday with the VB code FirstDayOfWeek.Tuesday . Is there a VB code where I can have Wed-Fri set as one variable instead of having to create separate variables and “If” activities for Wednesday, Thursday, and Friday individually?


#2

IF

now.DayOfWeek = DayofWeek.Wednesday OR now.DayOfWeek = DayofWeek.Thursday OR now.DayOfWeek = DayofWeek.Friday


#3

Thank you for replying!

Is there one VB code that I could use that would include Wednesday, Thursday, and Friday in one code?


#4

That goes into one If activity, else you can keep your Days in list and the compare in IF which will be 2 steps.

or

now.DayOfWeek>DayofWeek.Tuesday AND now.DayOfWeek<DayofWeek.Saturday


#5

can you gei me some demo include the vb or C# code,thank you very much


#6

How i do it :

Assign : [todayName] = [now.dayofweek.tostring]

If =
todayName = “Friday”

Then =

here is an example of part of my bot to skip the weekend. ( if friday, add 3 days to working date )