Converting a string variable into date

Pl. find below the screenshot:

@Dr_Raza_Abidi_PhD

Check below post for your reference

Hope this will help you

Thanks

No I have seen that post but my issue is something different. pl. see the screenshot. Many thanks,

it is highly recommended to do such check on datetime base, not on string base

You can use

  • DateTime.Parse(stringDate)

  • DateTime.ParseExact(stringDate, “yyyy-MM-dd”, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None): this method is especially useful when you know the string format to parse

You can then run a comparison check after converting both variables to DateTime

@Praise_JJ :

AOD
06/29/2010 00:00:00
09/01/2010 00:00:00
02/20/2012 00:00:00
12/06/2018 00:00:00
12/06/2013 00:00:00
10/01/2014 00:00:00
10/31/2001 00:00:00
12/29/2008 00:00:00
04/30/2019 00:00:00
12/21/2009 00:00:00
12/21/2009 00:00:00
12/21/2009 00:00:00
image

I have one column you can see and I want that if every row <= 07/02/2018
Then ETB
Else NTB

So it does not give the correct result. I have also pasted the UiPath screenshot above.

grafik
CDate("06/29/2010 00:00:00").Date <= New DateTime(2018,07,02).Date

@Praise_JJ :

Actually my date column is in for each row loop and I am comparing the row(“New_Date”) <= My_Static Date.

I have stored my static date using assign activity in the variable named ZNADate.

I hardcoded the rowDate = DateTime.Parse(Row(“AOD”).Tostring)
ZNADate =DateTime.Parse(“07/02/2018”)

@Praise_JJ : Thanks a lot, Issue gets resolved.

Many many thanks ok_hand:

Very grateful :slight_smile:

1 Like

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