Convert Date to Text Using Formula in Salesforce : Bijay Kumar

Convert Date to Text Using Formula in Salesforce
by: Bijay Kumar
blow post content copied from  SalesForce FAQs
click here to view original post



### Summary of Content on Converting Date Fields to Text in Salesforce In Salesforce, date fields are typically displayed in a standard format (YYYY-MM-DD), which may not be user-friendly for emails or reports. To make these dates more appealing, you can convert them into a text format using formulas. ### Key Details: - **Standard Date Format:** Salesforce displays dates in YYYY-MM-DD format by default. - **Need for Conversion:** Dates may need to be presented in a more readable form, such as "September 17, 2025." - **Using Formulas:** Salesforce requires the use of formulas to convert dates to text. - **Formula Syntax:** The basic syntax to convert a date to text is: ```plaintext TEXT(DATE(datefield)) ``` Or simply: ```plaintext TEXT(datefield) ``` - **Example of Conversion:** To extract just the year from a date in text format, you can use: ```plaintext TEXT(YEAR(datefield)) ``` ### Steps to Convert Date to Text in Salesforce Lightning: 1. Access Setup through the Gear Icon. 2. Navigate to Object Manager and select the desired object (like Accounts). 3. Create a new field and choose "Formula" as the type. 4. Enter the formula in the Advanced Formula editor: ```plaintext TEXT(DATE(YEAR(SLAExpirationDate__c), MONTH(SLAExpirationDate__c), DAY(SLAExpirationDate__c))) ``` 5. Set Field Level Security and choose visibility for profiles. 6. Save the formula field and it will now display the date in text format. ### Conclusion: The article outlines how to effectively convert date fields to text in both Salesforce Lightning and Classic using advanced formulas, making it easier to present dates in a user-friendly format. ### Additional Information: This conversion is particularly useful when generating reports or sending emails, where a more readable date presentation can enhance clarity and professionalism. ### Relevant Hashtags for SEO: #Salesforce #DateConversion #SalesforceFormulas #SalesforceLightning #CRM #EmailMarketing #SalesforceReports #DateToText #SalesforceTips #SalesforceClassic


In Salesforce, Date fields always show in standard date format, like YYYY-MM-DD. But sometimes, we need the Date in Text format for emails or reports.

Salesforce does not directly allow us to change Date to Text without using a formula.

For example, if we are sending an email and want to include the Date field, it will display in system format (YYYY-MM-DD). This may not look good for end users. By converting the Date into Text using a formula, we can show it as “September 17, 2025.”

In this article, we will learn about how to convert a date to text using a formula in Salesforce. In this, I will create and explain a formula using functions that display dates in text format.

Salesforce Formula Date to Text

In Salesforce, to convert the date field to a text data type, we use the Salesforce DATE() and TEXT() functions together.

Here is the syntax to convert a date to text in Salesforce:

TEXT(DATE(datefield))
#OR
TEXT(datefield)

In this code, enter the API name of the date field you want to convert to time for the Date Field. And this formula returns a new date in text format.

Let’s understand it in detail with the help of an example:

Let’s say we want to create a formula that returns only a year, but without the number place separated with commas. So, for this, we will create a formula that converts a Year to Text in Salesforce.

Here is the formula for this:

TEXT(YEAR(datefield))

Convert Date to Text Using Formula in Salesforce

Here are the steps to convert a Date to Text using the Advanced Formula in Salesforce Lightning.

  1. Go to the Gear Icon. -> Click on the Setup. -> Select the Object Manager tab. 
Salesforce Formula Date to Text
  1. Search for the object to which we want to convert the Date to Text. Here, I select the Accounts object from the list of objects.
Salesforce Formula Date to Text Example
  1. In the Account object setup, click on the Fields and Relationships to create a new field and click the New button.
Convert Date to Text Using Formula in Salesforce
Salesforce Lightning Formula Date to Text
  1. In this step, we will use a formula to convert the date into text format and display it on the account object. For that, select the option Formula from the data type and click Next.
Salesforce Lightning Example Formula Date to Text
  1. Next, provide the Field Label and API Name for the formula field. Then, since we want to convert and display the date in text format, in the  Formula Return Type, select Text and click on the Next button.
Convert Date to Text Formula in Salesforce Lightning
  1. Enter the Date to Text formula in the Advanced Formula editor. Here is the formula:
TEXT( DATE ( YEAR( SLAExpirationDate__c ), MONTH( SLAExpirationDate__c ), DAY( SLAExpirationDate__c ) ) )
  • In this formula, we extract the date from the custom field called “SLAExpirationDate__c” using the DATE, YEAR, MONTH, and DAY Salesforce functions. But by default, the DATE function returns the result in a date format.
  • To get the result in the text format, we will use the TEXT function with the DATE function.
  • Click Check Syntax to make sure the formula is correct. After that, click Next.
Convert Date to Text Formula in Salesforce Lightning Example
  1. Select the Field Level Security for the formula field, and select the profiles to make the field visible for the profiles. The field will be visible for the profiles selected from the Visible column.
    • After selecting the profiles, click on the Next button.
How to Convert Date to Text Formula in Salesforce Lightning
  1. In this step, we must select the field’s visibility on the object’s page layouts. In this case, we have created the formula field for the reports so we can choose not to display it on the page layouts.
    • Uncheck the checkboxes of the page layouts to prevent the field from displaying on them. After this, click on the Save button.
How to Convert Date to Text Formula in Salesforce Lightning Example

We can use the formula field once we’ve created it. Let’s look at an example:

  • Create or Open an account using the SLA Expiration Date value by opening the Accounts object and saving it.
  • After that, click on the Details section, and here the Text SLA Expiry Date field will appear in the text datatype format instead of the date datatype.
Convert Date to Text Formula in Salesforce

As a result, we now know how to use Salesforce Lightning’s advanced formula to convert a Date to Text. Next, we’ll look at how to use Salesforce Classic’s advance formula to convert Date to Text.

Conclusion

In conclusion, we have learned the advanced Salesforce formula to convert a Date to Text. Moreover, we have learned that both Salesforce Classic and Salesforce Lightning provide a simple procedure to convert a Date to Text.

In addition to this, the following are the topics that we have discussed:

The post Convert Date to Text Using Formula in Salesforce appeared first on SalesForce FAQs.


August 22, 2025 at 10:16PM
Click here for more details...

=============================
The original post is available in SalesForce FAQs by Bijay Kumar
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================

Salesforce