I have been reading all I could find in this forum about converting strings into datetime, but none of the threads answer this question.
I am reading a excel file and there is a column with date. This date, tho, can rather be a string or a date, and to check if is a date I use IsDate. However, when it is not a date, and i am trying to convert it to date, i ALWAYS encounter some kind of error.
Sometimes CDate works, and sometimes I get a “Cannot assign CDate(x) to date”. Then I use TryParse, and it works. However, sometimes TryParse does not work and I get the same error but with TryParse, or ParseExact.
Is like I cannot seem to find a ONE and specific formula to just convert any kind of string into date!! Could someone help me please?
However, this works when the input from the Input file is a date, and not when it’s a string. UiPath seems to get the Date column value as a string or date depending on how the user filled it in.
Then, there is this formula, which gives a string variable instead of a date:
And what’s the problem with that one? Well, when the input is a date, then it doesn’t work. The error in both formulas is the same: “Cannot assign XXX to XXX”