Comparing of dates

Hai every one,

I was having a list of dates and which has been collected from an excel.
I need to compare weather the date is before or after of my reference date such as 31-03-2019(DDMMYYYY)

can any one help me in resolving this issue.

Hi,

You can try this logic

Hope this helps

Thanks

Its better to convert the values to dates before doing the comparison. The below condition can be used in an IF statement.

//For each loop of list of dates
Datetime.ParseExact(ReferenceDate, “dd-MM-yyyy”, System.Globalization.CultureInfo.InvariantCulture) > Datetime.ParseExact(DateFromExcel, DateFormatInExcel, System.Globalization.CultureInfo.InvariantCulture)

thanks for your information

Hi
Welcome to uipath community
If the date we have is in a variable named strinput
Then inside the FOR EACH ROW loop with datatable variable passed as input use a IF condition like this

DateTime.ParseExact(row(“yourcolumnname”).ToString.SubString(0,10),”dd/MM/yyyy”,System.Globalization.CultureInfo.InvariantCulture) >DateTime.ParseExact(strinput.ToString,”dd-MM-yyyy”,System.Globalization.CultureInfo.InvariantCulture)

Cheers @sriharshacherukuri2