Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Custom Function help please


RichGags
 Share

Recommended Posts

Hey all!  I am trying to write a custom function to replace and/or substitute several items at once and I am having trouble with the syntax.

I need to take this input "Monday February 4 2019" and convert it to "2/4/2019". 

Basically I need to disregard the days of the week, replace the month text with the month number, and convert the spaces to slashes/

Any help would be greatly appreciated!    Thanks so much.

Link to comment
Share on other sites

Hi, you don’t need a custom function for that ... you can do it with a simple substitute function:

 

Substitute ( $dateSting ;

[“Monday ” ; “”] ;

[“Tuesday ” ; “”] ;

...etc. ...

[“January” ; 1 ] ;

[“February” ; 2 ] ;

... etc. ...

[“ “ ; “/“]

)

 

For good measure you might want to add multiple 

 

[“  “ ; “ “ ] ;

To convert multiple spaces to single spaces and finally wrap it all in a trim function. 

🙂

  • Like 1
Link to comment
Share on other sites

Just noticed we’re in the fm 11 room ..... If fm 11 doesn’t support the [] syntax, just use nested Substitute ( Substitute ( .... ; m ; “”) ; t ; “”) functions.

  • Like 1
Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

Terms of Use