Comparing Excel column data of date with system date

I want to compare the date of my excel data with system date. If it matches the matched rows will be copied to another sheet or excel file. But i’m not sure how to do it.

1 Like

Hi @nibir08,

Welcome @nibir08 to the community…

1.Take the date from the excel and compare that with Now.ToShortDateString ,this will give you the system date.

2.Then you can continue with your process…

Cheers.
Vashisht.

1 Like

@nibir08

Welcome to UiPath Community

1.use Excel Application scope in it use Read Range read the excel and store it in a Data table Dt1.
2.use assign and get system date=datetime.now.toString(“dd/MM/yyyy”)
3.parse the system date
DateTime.ParseExact(systemdate,“dd/MM/yyyy”,System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat)
4.use For each row
5.now we need to parse the date column,use Assign
DateTime.ParseExact(row(“column name”).ToString(),“MM/dd/yyyy hh:mm:ss”,System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat)
6.now use IF condition

Regards,
A Manohar

2 Likes

Hi @nibir08,

I’ll suggest you to follow the steps below.

  1. Use Read Range to get excel data into DataTable variable. (DT)
  2. Use Assign activity to filter DataTable with todays date. (As given below)
FilteredDT (DataTable) = DT.Select("[Dates] = '#"+DateTime.Today.ToString("MM-dd-yyyy")+"#'").CopyToDataTable

Dates —> Dates column name.

  1. Now you’ve filtered datatable (FilteredDT), so using Write Range you can put that data into another sheet.

That’s it. :slight_smile:

1 Like

new

what should i write in condition?
actually i’m new to uipath and still learning.

@nibir08

with system date

It worked!! Thnx a lot :smiley:

1 Like

@nibir08

cheers…
Happy automation…:grinning::grinning::grinning:

It worked like a charm :smiley:
thanx a lot :smiley:

You’re very welcome, @nibir08. :slightly_smiling_face:

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