function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
gizmo100gizmo100 

Formula field to a get date from a text field

 

Hi Everybody,

 

I have a text field (8 length) and I would like to create a formula field that converts the "01092009" to 01/09/2009"

 

thanks for you help!!

 

:)

 

Gizmo

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

Here, try this one 

DATEVALUE(RIGHT(TextField__c,4)+ "-"+ LEFT(TextField__c,2)+ "-"+ MID(TextField__c, 3, 2))

 

 

All Answers

Steve :-/Steve :-/

are you trying to convert the value from a Text string to an actual datatype:Date value?  or do you simply want to reformat it from Text: "XXXXXXXX"  to Text: "XX/XX/XXXX"? 

Steve :-/Steve :-/

Here, try this one 

DATEVALUE(RIGHT(TextField__c,4)+ "-"+ LEFT(TextField__c,2)+ "-"+ MID(TextField__c, 3, 2))

 

 

This was selected as the best answer
gizmo100gizmo100

Hi Stevemo,

 

Thanks!! That's great!!!! :)

 

You Rock!! ;)

 

Gizmo