Filter a recent date from duplicate data

Hi ,

i have this data with tow columns Name and date. I try to get duplicate value and get recent data and delete other values.

image

output:

image

can anyone help me please.

Thank you

Hi,

Hope the following sample helps you.

img20211212-2

dt = dt.AsEnumerable.GroupBy(Function(r) r("Name").ToString).Where(Function(g) g.Count>1).Select(Function(g) g.OrderByDescending(Function(r) DateTime.Parse(r("Date").ToString)).First).CopyToDataTable

Sample20211212-1.zip (2.6 KB)

Regards,

1 Like

Thanky you @Yoichi

1 Like

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