var sumWaitTime = source.Sum(item => item.A * (item.B - item.C));
linq不是有sum方法吗?还是说放在where里?
SELECT (sum(Call_No)-sum(UnCall_No)) SumCallNo ,sum(Process_Time_Total) SumProcessTime ,sum(Wait_Time_Avg*(call_no - uncall_no)) SumWaitTime ,max(Wait_People_Max) MaxWaitPeople "; strComm += " FROM branch_comparison_bykind WHERE BRANCH_ID='" + sDep.Trim() + "' " + commYear + commQuarter + commMonth + commWeekY + commWeekM + commDate;
这是SQL
@许大虾: branch_comparison_bykind.where(m=>m.BRANCH_ID=='"'+m.sDep+'"'+m.commYear++++).select(m=>new{SumCallNo= branch_comparison_bykind.sum(Call_No)-branch_comparison_bykind.sum(UnCall_No),SumProcessTime=branch_comparison_bykind.sum(Process_Time_Total)})
反正大概就这意思`
@吴瑞祥: SumCallNo= branch_comparison_bykind.sum(Call_No)-branch_comparison_bykind.sum(UnCall_No)
你这样写 传入的参数 会提示参数无效啊
@吴瑞祥: SUM()这括号里面是要传的是转换函数而不是这种参数啊
@许大虾: ```说了是大概这个意思撒.改成
SumCallNo= branch_comparison_bykind.sum(t=>t.Call_No)-branch_comparison_bykind.sum(t=>t.UnCall_No)
不就行了````