Filter a day before and the current date - Excel

Hi guys!

In excel, I wanna filter a column searching the day before and the current date. How can I do that?

Reguards

Hi, use the filter datatable activity full info here:
https://docs.uipath.com/activities/docs/filter-data-table

If you don’t understand something let me know.

Hi @Giulia_G,

Kindly follow the steps below.

  1. Use Read range activity and output var —> DT
  2. use assign activity as given below,
FilteredDT = DT.Select("[ColumnName] = '#"+Now.AddDays(-1).ToString("MM/dd/yyyy")+"#' OR [ColumnName] = '#"+Now.ToString("MM/dd/yyyy")+"#'").CopyToDataTable

Now you have filter data in FilteredDT.

Note - change MM/dd/yyyy date format as you have in your Excel sheet.

2 Likes

how can a column be equal to 2 different dates at the same time? :stuck_out_tongue_winking_eye:

I need to get the things from yesterday and from today.

I’m gonna try it and let you know!

Regards

Hi, guys! Am I doing something wrong?

image

I’m getting this error message

image

If I erase the “CopyToDataTable” (try set to clipboard after workout), I get this message

image

Some help?

the select command you give you an array of datarows, so you will need a variable of the type: DataRow()