You need to sign in to do that
Don't have an account?
Randombard2
Variable Does not exist second .get
For(AggregateResult ARCY:[SELECT SUM(Amount__c) mySum, COUNT(id) myCount, Account__c FROM Finance__c where Account__c =:Ac[0].id AND (Group__c = 'TOTAL' OR Group__c = 'Total') AND (Code__c Like '%YTD%' OR Code__c Like :'%'+LastYear+'%' OR Code__c Like :'%'+Year2+'%' OR Code__c Like :'%'+Year3+'%' OR Code__c Like :'%'+Year4+'%') GROUP BY Account__c]) myCount = double.valueOf(ARCY.get('myCount')); mySum = double.valueOf(ARCY.get('mySum'));The secont .get failes no matter what way around they are, feel like I have forgotten a limitation on AggregateResult
Hope it helps!
Can you help me understand why it works with the first .get but not the second?
So the following works fine: