Brian Dunning's FileMaker Custom Functions

ParseDate ( text )

Returns the first valid date found from a text string.

  Average rating: 4.3 (37 votes) Log in to vote

Vaughan Bromfield   Vaughan Bromfield - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
ParseDate( "CD Database 31/12/2008" )
  Sample output:
31/12/2008

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

This recursive function parses the supplied text and returns the first word that is a valid date. The function only recognises dates entered in the current system format. If there are no valid dates the function returns a null value.

To improve the success rate each word is filtered to remove non-numeric characters (except for potential date delimiters).

 

Comments

liverMD   liverMD, Newark NJ
Feb 8, 2010
Trying to set up this function in Edit custom function. My text field is designated "Import". When I try to save, I get the following message for ParseDate

ParseDate( RightWords( Import ; WordCount( Import ) - 1 ) )

"This Function cannot be found"
 
John   John
Jan 17, 2024
Unfortunately this cool function didn't work for me; it returned just a "?" from a text string that contained a US date. I'm not sure why, and maybe I'll get some time to debug it for my environment and will post here if I do.
 
John   John
Jan 17, 2024
The custom function "TextFindDateValues" worked in my environment, so I ended up using that instead.
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: