How to fix the error?

Hi, I am new for UiPath, and i trying to do a program that can check for expired date and send outlook mail to inform the person.

The rule is, when I run the program, it will check all the date in column J one by one, if the date in column J expired, then it will take the outlook mail in column R and send an email to inform the person “item expired”. If the date not expired then it will go to next row and continue checking the date in column J .

Below are the UiPath I trying to do and the excel file
Main.xaml (11.8 KB)
sample date.xlsx (9.9 KB)

Below are the error i get and how should I fix it?

@horo1016 Can you Show us the Expression used in the Assign Statement and also Show us the Value of Date Column in a Message Box.

Hi, @supermanPunch

Below is the Expression I used in the Assign Statement
image

And this is the value of the date column
image

@horo1016 I guess it Should be “MM/dd/yyyy HH:mm:ss”. Try this and let me know.

1 Like

Hi, @supermanPunch

It still show me the same error
image

@horo1016 You have used only yyy not yyyy

Hi @horo1016,

try this…
DateTime.ParseExact(row.Item("Next Cal Date").ToString,"MM/dd/yyyy hh:mm:ss",system.Globalization.CultureInfo.InvariantCulture)

OR

If you’re just comparing dates then you no need to worry about its format so you can use following too…

CDate(row.Item("Next Cal Date"))

1 Like

@samir @supermanPunch

Thank you very much for your help !! :smiley: Wish you guys have a nice day !!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.