Remove or filter rows which are not of current year

I have a datatable dt in which I have a column called Start Date along with other columns. Now the date format is “M/d/yyyy” in this start date column. I want to remove all those rows which are not of current year.
So if this year is 2024 then remove all other rows whose start date is anything else.

i/p dt:
image

o/p dt:
image

dtFiltered =

(From d in dtData.asEnumerable()
Let dps = d("Start Date").toString.Trim
Let dp = CDate(dp)
Where dp.Year = 2024
Select r =d).CopytoDataTable

Also have a look here:

1 Like

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