How to group a datatable?

Hi,

How about the following sample?

dt.AsEnumerable.GroupBy(Function(r) Tuple.Create(r("Place of Purchase").ToString,r("Material Number").ToString )).Select(Function(g) g.OrderBy(Function(r) CDate(r("Purchase Date"))).Last()).CopyToDataTable

Sample20231013-4L.zip (9.3 KB)

Regards,

1 Like