1

Right now I have a picklist field the I want to be used in an Email Template.

The picklist values are "Monday, January 17th 5:30 PM" and "Saturday, March 18th 10:00 AM".

The formula I have of now is {!MID(Contact.Date__c,1,LEN(Contact.Date__c) - 9)} which takes 9 characters from the right side and cuts it off which works for the Saturday, March 18th 10:00 AM but not for the other date.

How do I create a formula that is dynamic so the merge field works for both pick list values?

EX. If the user selects Monday, January 17th 5:30 PM it should return Monday, January 17th and if the user selects Saturday, March 18th 10:00 AM it should return March 18th 10:00AM.

4
  • Why don't you just use Datetime type fields to store the value? Then you could do DATEVALUE(Datetime_Field__c). – Adrian Larson Apr 5 '17 at 23:38
  • This is a specific case. I wish I could use a DATETIME field :( – Kevin Apr 5 '17 at 23:39
  • Are these two fixed values and would return as that example? – Santanu Boral Apr 6 '17 at 0:57
  • check your example, I think there something wrong in that – Santanu Boral Apr 6 '17 at 1:00
1

This formula will work for you. It will search for :, take the position and return the trimmed value.

{!TRIM(MID(ContactDate__c,1,FIND(":", ContactDate__c )-3))}

Example

Wednesday, March 18th 1:00 AM returns Wednesday, March 18th

Saturday, March 18th 10:00 AM returns Saturday, March 18th

Thursday, March 6th 2:00 AM returns Thursday, March 6th

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.