You need to sign in to do that
Don't have an account?
SeanCeno
Prior 12 Months Formula in Apex
Hey guys,
I'm trying to do a date range to grab all trades from past 12 months, from yesterday's date. For some reason the following 2 formulas will not work. Any help would be greatly appreciated!
Returns nothing:
Returns only dates within the past month:
I'm trying to do a date range to grab all trades from past 12 months, from yesterday's date. For some reason the following 2 formulas will not work. Any help would be greatly appreciated!
Returns nothing:
if(trade.trade_date__c < date.today().addDays(-1) && trade.trade_date__c > date.today().addDays(-366)) { accounts.get(trade.Resolved_Firm_Trading_ID__c).put(prior12MOS.get(trade.fund_number__c)[0], ((Decimal)accounts.get(trade.Resolved_Firm_Trading_ID__c).get(prior12MOS.get(trade.fund_number__c)[0]))+trade.Dollar_Amount_of_The_Transaction__c); accounts.get(trade.Resolved_Firm_Trading_ID__c).put(prior12MOS.get(trade.fund_number__c)[1], ((Decimal)accounts.get(trade.Resolved_Firm_Trading_ID__c).get(prior12MOS.get(trade.fund_number__c)[1]))+trade.Number_of_Shares_of_the_transaction__c); system.debug(prior12MOS); system.debug(LoggingLevel.DEBUG, + Limits.getCpuTime() + '/' + Limits.getLimitCpuTime());
Returns only dates within the past month:
if(trade.trade_date__c < date.today().addDays(-1) && trade.trade_date__c > date.today().addYears(-1)) {
All Answers