Converts a string into a Date data type in Salesforce Spiff. This function finds the date value for a field that isn't specifically a Date data type so that Spiff can use the date value in calculations and other functions related to dates.
Required Editions
Available in: both Salesforce Classic (not available in all orgs) and Lightning
Experience
Available in: Enterprise, Unlimited, and Developer
Editions
Available for an additional cost in: Professional Edition with Web
Services API Enabled
Syntax
date(string)
Arguments
Argument
Required?
Description
string
Required
A string representation of a date in the YYYY-MM-DD format, enclosed in double quotes. For a summary calculation, manually enter a date or reference a field that contains date values.
Considerations
If you have a date field but Spiff interprets the field's data type as a String, change the data type of the field directly to Date instead of using the date() function.
Example
Indicate that plan assignment custom field, named RampStartDate, is a date.
=date(plan_assignment.RampStartDate)
Create a data filter that returns only deals with close dates after January 1, 2025, and convert the hard-coded date in text format to a date value.
CloseDate > date("2025-01-01")
Convert the CreatedDate time stamp, which is a Date & Time value, to only a Date value.
=date(CreatedDate)
Did this article solve your issue?
Let us know so we can improve!
Loading
Salesforce Help | Article
Cookie Consent Manager
General Information
Required Cookies
Functional Cookies
Advertising Cookies
General Information
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required Cookies
Always Active
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional Cookies
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising Cookies
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.