Filter Data table with date column

Data table with column “RecallDate” need to filter and keep rows only if the dates available in RecallDate column in DT is between today and -7 days from today.

Attached the DT file
Recalls.xlsx (10.8 KB)

Expected output :–
Expected_Output.xlsx (10.6 KB)

Hi @Sathish_Kumar_S,

Try with the below query

YourDataTable.AsEnumerable.Where(Function(x)CDate(x("Date").ToString).Date>=Now.Date AndAlso CDate(x("Date").ToString).Date<=Now.AddDays(-7).Date).CopyToDatatable

Assign Activity
dtFiltered =

(From d in dtData.AsEnumerable
Let dp = CDate(d("RecallDate").ToString.Trim).Date
Where dp >= Now.AddDays(-7).Date And dp <= Now.Date
Select r =d).CopyToDataTable

Let us know, what was blocking you to set it up by your own. So we can assist for your learnings

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