Brian Dunning's FileMaker Custom Functions

FMStoSQLDate ( input )

Convert FM date to SQL Date

  Be the first to rate this function Log in to vote

Agnes Riley   Agnes Riley - Show more from this author
ZeroBlue
https://www.zerobluetech.com

Share on Facebook Share on Twitter

  Sample input:
FMStoSQLDate ( "12/8/2013" )
  Sample output:
6

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

This function takes a FileMaker date and converts it to a SQL Date. It accounts for a month in FileMaker being a single-digit string.

 

Comments

Kevin Kondo   Kevin Kondo, Carpe Datum Inc.
Feb 10, 2021
Hi Agnes, this fails to insert leading zero's in front of Days with single digits. That caused problems when I tried to pattern-match. I opted for:
Let([
xList = Substitute ( input ; "/" ; "¶" );
y1 = GetValue ( xList ; 3);
m1 = Right ("0" & GetValue ( xList ; 1); 2);
d1 = Right ("0" & GetValue ( xList ; 2); 2)
];
y1 & "-" & m1 & "-" & d1)
 

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: