I know this is an old question, but hey I found it, so hopefully this helps someone else ...
You can also do this using the Fluent syntax:
var sums = dc.Deliveries .Where(d => d.TripDate == DateTime.Now) .GroupBy(d => d.TripDate) .Select(g => new { Rate = g.Sum(s => s.Rate), AdditionalCharges = g.Sum(s => s.AdditionalCharges) });
Hope this helps someone ...
Dan vanwinkle
source share