How to filter data table with respect to Date and time?

I have a table, I have to filter the table with respect to “Joining date” column the date is “30-Aug-22” and in excel the column is in date format.
Can you please any one help me… Thank You
Employee.xlsx (8.5 KB)

Hi @vanithavs

You can change the format of the column using Change Cell Format activity

Check out the XAML file

FilterDate.xaml (9.5 KB)

image

Regards
Gokul

@vanithavs
I am not getting your what type of issue you are facing.

Hi @vanithavs

You can also try with Format Cells activity (Modern activity)

image

Regards
Gokul

for filtering we do have following options:

for analyzing the details within the read range we can do:
:ambulance: :sos: [FirstAid] Datatable: Debug & Analysis invalid DateTime Strings / String to DateTime Parsing Issues - News / Tutorials - UiPath Community Forum

Once you ghave cleared the format representing the dates the filter approach option can be decided and implemented.

feeld free to share with us the date sample values from the data table after the initial analysis, so we can also help for the appoach selection and implementation based on this

Hi Vanithavs,

Follow the below steps to achieve your task:-

  1. Use Filter datatable activity, Click on Configure.
  2. Provide Input DataTable , provide the row name as “joining date” , condition as “=” and Values "“30-Aug-22”. refer the attach screenshot for the reference.

If this sounds good to you, please mark it as an SOLUTION.

Thanks

This is not working because the date “30-Aug-22” column is in Date format in excel. So please any one help me regarding this.

Hey @akshay5

Can you share the below workflow

Regards
Gokul

what is the second activity you have used

Hi @vanithavs

Check the screenshot

Go to manage package → All package → Install balareva.excel.activities

Regards
Gokul

Hi, Thank for your suggestion…
But I can’t use third part package, can you please provide me any other suggestion.

Hi @vanithavs

Check out the updated XAML file

FilterDate.xaml (13.5 KB)

Regards
Gokul

1 Like

Hello @vanithavs ,

You can use the excel application scope and .Select method to achieve this.

Used Query :

outputDT = InputDT.Select(“[Joining date]=‘30-Aug-22’”).CopyToDataTable

Output :
image

Workflow :
image

Forum_DateFilter.zip (2.5 KB)

Regards,
Rohith

Here am getting value as 0

Hi @vanithavs

Check out the Updated XAML file

FilterDate.xaml (13.5 KB)

Output

image

Regards
Gokul

DT.Asenumerable.Where(Function(r) CDate(r(“joining Date”).tostring).Date=CDate(“30-Aug-22”).Date).Copytodatatable

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