Hi all
I have the following query
var q = from item in new DataAccess.IncidentRepository().GetItems()
group item by new
{
item.Supplier,
item.SupplierPlant
}
into item
select new
{
SupplierId = item.Key.Supplier.Id,
SupplierName = item.Key.Supplier.Name,
SupplierPlant = item.Key.SupplierPlant.Plant,
Years = from incident in item
let year = incident.IncidentDate.Year
group incident by year into downtimeForYear
select downtimeForYear.Sum(i => int.Parse(i.DownTime))
};
This works but I need to have say columns from 2006 -> 2009 where as now it just becomes two items say 2006 and 2009. I need to add 0's for the other years
Regards