I have a table in the following format:
Type Date Code
1 01/01/13 AA
1 01/01/13 AB
1 01/01/13 FV
1 02/01/13 AE
Using a join against another table, I can bring back the highest date by :-
g.Max(d => f.Field<DateTime>("End Date"))
which returns 02/01/13. What I would like to know is how to return “AE”, ie: the value in the adjacent column.
It you’re using LINQ to Objects (as it appears, having fetched a
DataTable), you can use MoreLINQ which has aMaxBymethod:(Disclaimer: I started MoreLINQ a while ago, although others are now more active than I am.)