Hello
I've got a list:
ID--------Date-----------NumValue
1---------2/2/2013----------0
1---------2/2/2013----------2
1---------1/1/2013----------4
2---------10/5/2009---------3
2---------01/01/2005--------4
I'd like to get back all the line items with the max(not necessarily one) date value
so the aim is to get back 0th 1 st 3 rd line
the weak attempt as follows:
var plpo1 = (from y in plpo0
group y by new { y.tervcsop, } into grouped
let maxdate = grouped.Max(y => y.maxdate)
orderby maxdate descending
select new
{
tcs = grouped.Key.tervcsop,
md = maxdate,
norm = grouped.Select(x => x.normaertek)
}).ToList();
var plpo2 = plpo1.Where(x => x.md == plpo1.Max(o => o.md));
thanks for sharing the ideas