Loading
销售业绩管理
months_ago

months_ago

返回 Salesforce Spiff 中另一个日期之前指定月数的日期。

所需的 Edition

适用于:Salesforce Classic(并非在所有组织中可用)和 Lightning Experience
适用于:EnterpriseUnlimitedDeveloper Edition
另行付费后适用于:启用了 Web 服务 API 的 Professional Edition

语法

months_ago(start_date, number_of_months)

参数

参数 必需? 描述
start_date 必需 要评估的日期值。此参数支持任何日期函数。要将日期指定为 YYYY-MM-DD 格式的字符串,请使用 date() 函数并将字符串括在双引号内。
number_of_months 必需 一个整数,指定查找日期之前或之后的月数。正值表示过去的月份,负值表示未来的月份。

注意事项

要返回上个月的最后一天,请使用 days_ago() 函数。

示例

返回报表期前三个月的日期。

=months_ago(statement_period.start_date, 3)

返回报表期后三个月的日期。

=months_ago(statement_period.start_date, -3)

返回上一季度开始的日期。

=months_ago(beginning_of_quarter(statement_period.start_date), 3)

返回上一季度末的日期。

=months_ago(end_of_quarter(statement_period.start_date), 3)

返回三个季度前的开始日期。对于 2 月报表期间,四分之三前的开始日期是前一年的 4 月 1 日。

=months_ago(beginning_of_quarter(statement_period.start_date), 9)

另请参阅:

 
正在加载
Salesforce Help | Article