Skip to main content
We have a ship date field (shipdate__c) currrently in the format of 20171219 and want to convert to a date field of 12/19/2017.  Have tried several variations of datevalue but can't seem to get it to work.
7 réponses
  1. 20 oct. 2018, 08:49
    Hi Scott,

     

    Looks like the data type of your ship date field is text. So going forward you have two options:

     

    1. You can create a formula field with return type text, and this formula:

    MID(Ship_date__c,5,2)+"/"+

    RIGHT(Ship_date__c,2)+"/"+

    LEFT(Ship_date__c,4)

     

    But since it will be a text field so you won't be able to perform operations on this field like you normally do on a date field. So therefore, comes the second option.

     

    2. So instead of creating a formula field with return type text, create a formula field with return type Date

    , and use this formula.​​​​​​​

    DATE(

    VALUE(LEFT(Ship_date__c,4)),

    VALUE(MID(Ship_date__c,5,2)),

    VALYR(RIGHT(Ship_date__c,2))

    )

     

     
0/9000