Brian Dunning's FileMaker Custom Functions

GetAsDateSmart ( input )

GetAsDate, but Consider FM formatted dates and timestamps, and SQL formatted dates and timestamps and convert them to a FileMaker Date

  Average rating: 5.0 (1 vote) Log in to vote

Robert D Trammel   Robert D Trammel - Show more from this author
Harmonic Software Production Studios
https://team.harmonic-data.com

Share on Facebook Share on Twitter

  Sample input:
1) GetAsDateSmart( "9/1/2022" )
2) GetAsDateSmart( "2022-2-28" )
3) GetAsDateSmart( "9/4/2022 10:30:00 AM" )
4) GetAsDateSmart( "2022-13-35" )
  Sample output:
1) 6/1/2022
2) 2/28/2022
3) 9/4/2022
4) Invalid Date Input [value: 2022-13-30]
Input Month was 13.

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

GetAsDate, but Consider FM formatted dates and timestamps, and SQL formatted dates and timestamps and convert them to a FileMaker Date. Also has some logic built in to give better feedback as opposed to just a "?".

 

Comments

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 18 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: