Skip to content

Instantly share code, notes, and snippets.

@isanuki
Last active December 15, 2015 23:59
Show Gist options
  • Save isanuki/5343999 to your computer and use it in GitHub Desktop.
Save isanuki/5343999 to your computer and use it in GitHub Desktop.
SOQL 日付関数サンプル
AggregateResult[] results = [SELECT FISCAL_YEAR(CloseDate) year,
SUM(Amount) summary
FROM Opportunity
WHERE IsWon = true
GROUP BY FISCAL_YEAR(CloseDate)];
for(AggregateResult ar: results){
System.debug('年度='+ ar.get('year')
+ ':金額='+ ar.get('summary'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment