8,497
社区成员
发帖
与我相关
我的任务
分享
var reportQuery = from a in examReportTable.AsEnumerable()
join b in rvuTable.AsEnumerable()
on new { exam = a.Field<string>("exam"), examtype = a.Field<string>("examtype") } equals new { exam = b.Field<string>("rvuName"), examtype = b.Field<string>("rvuType") }
group b by new { reportDoc = a.Field<string>("reportDoc"), examtype = a.Field<string>("examtype") } into c
select new
{
DocName = c.Key.reportDoc,
examType = c.Key.examtype,
reportDocRvu = c.Sum(o => double.Parse(o.Field<string>("reportRvu"))),
reportDocNum =//examReportTable中对“exam”计数count这句怎么写?
};
var reportQuery = from a in examReportTable.AsEnumerable()
join b in rvuTable.AsEnumerable()
on new { exam = a.Field<string>("exam"), examtype = a.Field<string>("examtype") } equals new { exam = b.Field<string>("rvuName"), examtype = b.Field<string>("rvuType") }
group new {a,b} by new { reportDoc = a.Field<string>("reportDoc"), examtype = a.Field<string>("examtype") } into c
select new
{
DocName = c.Key.reportDoc,
examType = c.Key.examtype,
reportDocRvu = c.Sum(o => Convert.ToDecimal(o.Field<string>("reportRvu"))),
reportDocNum =c.Count(x=>x.Field<string>("exam")==x.Field<string>("exam"))
};
LinkDataBase rvuLink = new LinkDataBase();
rvuDs = rvuLink.SelectDataBase(rvuSendStrSQL, rvuSendTableName, rvuSendConnectionString);
rvuTable = rvuDs.Tables[0];
LinkDataBase examLink1 = new LinkDataBase();
examReportDs = examLink1.SelectDataBase(examReportSendStrSQL, examSendTableName1, examSendConnectionString);
examReportTable = examReportDs.Tables[0];
var reportQuery = from a in examReportTable.AsEnumerable()
join b in rvuTable.AsEnumerable()
on new { exam = a.Field<string>("exam"), examtype = a.Field<string>("examtype") } equals new { exam = b.Field<string>("rvuName"), examtype = b.Field<string>("rvuType") }
group new {a,b} by new { reportDoc = a.Field<string>("reportDoc"), examtype = a.Field<string>("examtype") } into c
select new
{
DocName = c.Key.reportDoc,
examType = c.Key.examtype,
reportDocRvu = c.Sum(o => Convert.ToDecimal(o.Field<string>("reportRvu"))),
reportDocNum =c.Count(x=>x.Field<string>("exam"))
};