CCF Query Syntax question: Select statement for Custom Field

I have a simple syntax question (I think).  I am trying to get the statement below to work, but am having a problem with the syntax at the Select statement.  Any advice would be great:

I tried this and it is failing at "x.GetCustomField("Sample Weight/g")": 
CurrentSequence.AllPeaksAndGroups.Where(function (x) x.Injection.Sample.Sample_Type = 3) .Where(function (x) x.Injection.GetStringCC("SampleNameT") = CurrentInjection.GetStringCC("SampleNameT")).Where(function (x) x.Compound_Name = CurrentPeakOrGroup.Compound_Name).Select(function(x) x.GetCustomField("Sample Weight/g")).Average

I also tried creating a CC named "Sample_Wgt" with a CCF of " CurrentSample.GetCustomField("Sample Weight/g")" and then plugging that into the above query, but that only grabs the value for the current injection:
CurrentSequence.AllPeaksAndGroups.Where(function (x) x.Injection.Sample.Sample_Type = 3) .Where(function (x) x.Injection.GetStringCC("SampleNameT") = CurrentInjection.GetStringCC("SampleNameT")).Where(function (x) x.Compound_Name = CurrentPeakOrGroup.Compound_Name).Select(function(x) Sample_Wgt).Average.  

Was this helpful?