Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from field in FieldsList
- join nutM in ResultsList on field.ID equals nutM.fieldID
- join sTst in TestsList on field.ID equals sTst.fieldID
- where nutM.cropYear >= startYear && nutM.cropYear <= endYear
- orderby field.Name, nutM.cropYear
- select new {
- fieldName = field.Name,
- nutM.cropYear,
- AppProblems =
- (
- Convert.ToDateTime(sTst.TestDate).Year < 1955 ? test missing" :
- nutM.AppProblems != null && nutM.AppProblems != "" ? nutM.AppProblems :
- determineTestTooOldOrNot(nutM.cropYear, sTst.TestDate) ? "test too old " + sTst.TestDate :
- field.Acres/5 > // the number here needs to come from a subquery..subquery is mentioned below. Subquery returns the count after grouping by field name. However I do not know how to access the count value and compare it against field.Acres value.
- (from f in BasicDataAccess.Data.FieldsList
- join c in BasicDataAccess.Data.TestSamplesList on field.ID equals c.fieldID
- where f.Name == field.Name
- group f by f.Name into p
- select new
- {
- aSamples = p.Count()
- })
- )
- }
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement