Current date to last 90 days filter in data table

Hi I have one datatable in that last 10 years data available in that everyday i need to take the last 90days data and share to some one how to filter current date to last 90days

Hi @Shriharsha_H_N

=> Use read range workbook activity to read the excel and store in a datatable. Output → dt_Excel
=> Use the LinQ query to filter the data.

Assign -> filteredDataTable = originalDataTable.Select("[DateColumn] >= #" & DateTime.Now.AddDays(-90).ToString("MM/dd/yyyy") & "#").CopyToDataTable

=> Use the Write range workbook activity to write the filteredDataTable to excel.

Hope it helps!!

@Shriharsha_H_N

Please try this

Dt.AsEnumerable.Where(function(x) Cdate(x("DateCol").ToString) > Now.Adddays(-90)).CopyToDataTable

Cheers

1 Like

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