Compiler Error: Overload Resolution Failed Because No Accessible 'ToDateTime' Accepts This Number of Arguments

studio
error

#1

I’m building a sequence that will add multiple dates to a new datatable. One date is pulled from an existing table and passed into a generic variable (Date1), and in one column of the new table the variable is populated as-is. However, in the next column I need the input the date for the Saturday on the same week as Date1.

Within the For Each Row activity, I am trying to add an Assign activity but I keep getting the error in the subject line. The assign is set up

Date2 = Date1.ToDateTime.DayOfTheWeek.Saturday

Both variables are set up as Generic Values; not sure what I need to do differently here,


#2

Hi, @jcarr79
I hope this answer will be Useful to You…
Format(DateAdd(“d”, (-1 * WeekDay(CDate(“10/5/2017”) ) +7 ), Date.Today()), “dd/MM/yyyy”)
The above code print the Saturday of the week based date like(10/5/2017)

Regards,


#3

“Format” does not come up as a method within ToDateTime?


#4

Try this Date2 = Date1.AddDays(6 -Date1.DayOfWeek).Date

Date1 and Date2 is DateTime Variable


#5

Making the variable DateTime in the first place worked - I had tried that previously but mistakenly thought that it was converting everything to 01/01/0001. I realize now that there are just many blank cells and I will need to set up conditions to not populate those - thank you!


#6

Hi, @jcarr79

Format is function Comes under String
In this statement we used that Format for printing string in date format like (dd/MM/yyyy)

Regards,