Delete Duplicate Rows that and keeping the row with the newest date

Hello There,

You can try adjusting the following. It worked for me.

dtRaw.AsEnumerable.GroupBy(Function(r) r(“Name”).ToString).Select(Function(g) g.OrderBy(Function(r) DateTime.ParseExact(r(“Date”).ToString, “MM/dd/yyyy”,System.Globalization.CultureInfo.InvariantCulture )).Last).CopyToDataTable()

Best,
Ozzy

1 Like