//---------- Get PCPMM (R_mon) Sum Value----------//
dSumPCPMMRmon = Convert.ToDouble(dtCalcValForPCP.AsEnumerable()
.Where(d => d.Field<DateTime?>("date_dt") != null &&
d.Field<DateTime>("date_dt").Month == iMonth && d.Field<DateTime>("date_dt").Year == iYear)
.Sum(r => r.Field<decimal>("Rainfall")));
//---------- Get averagePCP Average Value----------//
averagePCP = Convert.ToDouble(dtCalcValForPCP.AsEnumerable()
.Where(d => d.Field<DateTime?>("date_dt") != null &&
d.Field<DateTime>("date_dt").Month == iMonth && d.Field<DateTime>("date_dt").Year == iYear)
.Average(r => r.Field<decimal>("Rainfall")));
var query = (dtCalcValForPCP.AsEnumerable()
.Where(result1 => result1.Field<DateTime?>("date_dt") != null &&
(result1.Field<DateTime>("date_dt").Month == iMonth && result1.Field<DateTime>("date_dt").Year == iYear) &&
result1.Field<decimal>("Rainfall") == 0
).Count());
dSumPCPMMRmon = Convert.ToDouble(dtCalcValForPCP.AsEnumerable()
.Where(d => d.Field<DateTime?>("date_dt") != null &&
d.Field<DateTime>("date_dt").Month == iMonth && d.Field<DateTime>("date_dt").Year == iYear)
.Sum(r => r.Field<decimal>("Rainfall")));
//---------- Get averagePCP Average Value----------//
averagePCP = Convert.ToDouble(dtCalcValForPCP.AsEnumerable()
.Where(d => d.Field<DateTime?>("date_dt") != null &&
d.Field<DateTime>("date_dt").Month == iMonth && d.Field<DateTime>("date_dt").Year == iYear)
.Average(r => r.Field<decimal>("Rainfall")));
var query = (dtCalcValForPCP.AsEnumerable()
.Where(result1 => result1.Field<DateTime?>("date_dt") != null &&
(result1.Field<DateTime>("date_dt").Month == iMonth && result1.Field<DateTime>("date_dt").Year == iYear) &&
result1.Field<decimal>("Rainfall") == 0
).Count());
No comments:
Post a Comment