Good Afternoon! Everyone I have an excel sheet in that different dates are there. I want to now that date is more than 18 days or not. Please can any one help in this

New Microsoft Office Excel Worksheet.xlsx (8.1 KB)

Thanks a lot,

Can compare the dates available in the excel with todays date and find the difference days . If days are greater than 18 or lesser than 18

how to check i am new to uipath


@mohammed_zain What do you want to do when the Date is more than 18 Days?

I want to check whether the dates are more than 18 days or not.

Mohd Zain

Simple method:-
TimeSpan t = date2.Subtract(date1);

other method:-
DateDiff(DateInterval.Day, “Date1”,“Date2”)

@mohammed_zain Follow these Steps :

  1. Use Read Range Activity and get the Datatable.
  2. Use For Each Row
    Inside For Each use an if Activity with Condition CDate(row(“Date”).toString)>Now.AddDays(18)
    if true you can use a Message Box
    Use Write Line

ok i will try

What to write in message box to display result.

Thanks a lot,

Pass the variable in messagebox as string and check it

Sorry! Not getting the output

Mohd zain

BlankProcess11(20-2-2020).zip (10.2 KB)

Please review this code i am not getting the result.
Mohd Zain

@mohammed_zain Can you check this : (11.7 KB)

ok i will check


@mohammed_zain Show me the output What you get and Notify me if it is right :sweat_smile:


Getting this error at run time.


@mohammed_zain Ok, Can you use the Message Box before the If Condition and Check How the Date Value Appears and Send Screenshot ?

ok i will sent the screenshot

@mohammed_zain Just Replace the Condition in if with this :
Datetime.ParseExact(row(“Date”).ToString,“MM/dd/yyyy HH:mm:ss”,System.Globalization.CultureInfo.InvariantCulture)>Now.AddDays(18)