2

I want to have a formula field that displayes the Start Date of an event to the End Date of an event, i.e (01/01/2017 - 31/12/17) - Like this

But when I try to make it like this I can't as the dash gets read as text and it creates a syntaxt error. When I make the formula text, the field looks like this : 2017-01-01 - 2017-12-31

Is it possible to get the format I want, if so could I get help with the formula?

1 Answer 1

2

You need to ensure your formula return type is text.

You can use the DAY(), MONTH() and YEAR() functions wrapped in a TEXT() method to build the format you want, concatenating "-" and "/" characters where appropriate:

TEXT(DAY(Start__c)) & "/" & TEXT(MONTH(Start__c)) & "/" & TEXT(YEAR(Start__c))
& " - " &
TEXT(DAY(End__c)) & "/" & TEXT(MONTH(End__c)) & "/" & TEXT(YEAR(End__c))

Something like the above should work.

2
  • You're an absolute legend, mate
    – Alex
    Jun 26, 2017 at 12:57
  • @Alex Happy to help! :)
    – Dan Jones
    Jun 26, 2017 at 14:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .