Hi,
Glad you got it working. Of course the snag with anonymous types is that you can't use them outside the method - if you need to do that then you'll need a matching concrete class.
BTW it looks as if the problem with my original suggestion lies in the way in which it is compiled to SQL - see my recent post to Rob.....
>Just to update you Viv your anonymous type code worked perfectly as well - thanks again.
>
>Edit
>
>This is what I've settled on
>
>
>var results = Context.invoices.Where(x => x.invoiceamount >= InvoiceAmount).GroupBy(x => x.client)
> .Select(group => new { companyname = group.Key.companyname,Id = group.Key.id, invoices = group.OrderByDescending(x => x.invoiceamount) })
> .OrderByDescending(group => group.invoices.Sum(x => x.invoiceamount)).ToList();
>