如何使用 Salesforce 公式字段计算日期是否超过“2 年前”?

How to calculate if Date is more than "2 years ago" with a Salesforce formula field?

如果日期超过 2 年,我需要在自定义字段中计算...如果是,则 return 是,否则 return 否

我正在尝试使用此公式,使 return 类型为 "text" Last_won_deal_date__c > DATEVALUE("2 years ago") 但出现以下错误:

Error: Formula result is data type (Boolean), incompatible with expected data type (Text).

有很多示例公式可以帮助您入门:https://help.salesforce.com/articleView?id=formula_examples_dates.htm&type=5(检查 "Finding the Number of Days Between Two Dates" 部分)

尝试 IF(Last_won_deal_date__c < TODAY() - 2 * 365, 'YES', 'NO') 或它的一些变体。