Select app.Application_Category as appcat,
SUM(Total_Expected_Availability) as tot_exp_avl,
SUM(Planned_Outage) as tot_pld,
SUM(Unplanned_Outage) as tot_unpld,
SUM(Unplanned_Outage- Unplanned_SignOff) as tot_unpld_sgn,
app.MSL,
app.ESL,
(Sum(Total_Expected_Availability-Planned_Outage-(Unplanned_Outage+Unplanned_SignOff))/SUM(Total_Expected_Availability-Planned_Outage))*100 as perc_achd
from App_Master_2 app
inner join Outage_Metrics outmet on app.Application_Category=outmet.Application_Category and app.Application_ID=outmet.Application_ID
where outmet.Month='9' and outmet.Year='2013'
Group by app.Application_Category,app.MSL,app.ESL
i tried like this but it shows error
maindashboardreport = (from outMet in lstOutage_Metrics
join app in lstApp_Master_2
on outMet.Application_ID equals app.Application_ID
where outMet.Application_Category == app.Application_Category && outMet.Month == monthValue && outMet.Year == yearValue
group app by new { app.Application_Category, app.MSL, app.ESL, outMet.Total_Expected_Availability, outMet.Planned_Outage, outMet.Unplanned_Outage, outMet.Unplanned_SignOff } into g
select new
{
g.Key.Application_Category,
g.Sum(t => t.Total_Expected_Availability).GetValueOrDefault(),
g.Sum(t => t.Planned_Outage).GetValueOrDefault(),
g.Sum(t => t.Unplanned_Outage).GetValueOrDefault(),
(g.Sum(t => t.Unplanned_Outage).GetValueOrDefault() - g.Sum(t => t.Unplanned_SignOff).GetValueOrDefault()),
g.Key.MSL.GetValueOrDefault(),
g.Key.ESL.GetValueOrDefault()
}).Distinct().ToList();
pls help me to fix this..