You need to sign in to do that
Don't have an account?

Formula to convert text into a Date
How to write a salesforce formula to convert the field Date_of_Withdrawal_String__c (text) field which has he data as "2017-04-30 00:00:00" into a Date field to show the date as 30/04/2017.
IF(DAY(DateValue(Date_of_Birth__c)) < 10, TEXT(DAY(DateValue(Date_of_Birth__c))), '0'+TEXT(DAY(DateValue(Date_of_Birth__c)))) +'/'+ IF(MONTH(DateValue(Date_of_Birth__c)) < 10, TEXT(MONTH(DateValue(Date_of_Birth__c))), '0'+TEXT(MONTH(DateValue(Date_of_Birth__c)))) +'/'+ TEXT(YEAR(DateValue(Date_of_Birth__c))), null)
Please ignore brackets or comma as i have writter in notepad, plz correct the syntax if it have any error.
Or you can also go with the simple formula by using DATEVALUE(Date_of_Withdrawal_String__c ) but it will give the format as "MM/DD/YYYY"
Hope this will help!
All Answers
It returns a date value for a date/time or text expression.
Refer this link : https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_variables_functions.htm
IF(DAY(DateValue(Date_of_Birth__c)) < 10, TEXT(DAY(DateValue(Date_of_Birth__c))), '0'+TEXT(DAY(DateValue(Date_of_Birth__c)))) +'/'+ IF(MONTH(DateValue(Date_of_Birth__c)) < 10, TEXT(MONTH(DateValue(Date_of_Birth__c))), '0'+TEXT(MONTH(DateValue(Date_of_Birth__c)))) +'/'+ TEXT(YEAR(DateValue(Date_of_Birth__c))), null)
Please ignore brackets or comma as i have writter in notepad, plz correct the syntax if it have any error.
Or you can also go with the simple formula by using DATEVALUE(Date_of_Withdrawal_String__c ) but it will give the format as "MM/DD/YYYY"
Hope this will help!