Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 9.5   10.0   10.1   10.2   10.3   10.4   10.5   11.0   11.1   11.2    Statistic    FMM    Blog  

SQL.ConvertDateTimeToSQL

Converts a date/time/timestamp to SQL text.

Component Version macOS Windows Linux Server iOS SDK
SQL 11.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "SQL.ConvertDateTimeToSQL"; Value )   More

Parameters

Parameter Description Example
Value The date, time or timestamp value.
Text or number are converted by FileMaker to get a timestamp.
Get(CurrentDate )

Result

Returns text or error.

Description

Converts a date/time/timestamp to SQL text.
Localization of FileMaker time and date formats applies. Examples below are in German format.

Similar function is used internally by SQL.SetParamValue, SQL.SetParamAsDate, SQL.SetParamAsDateTime and SQL.SetParamAsTime to convert values automatically for you.

Examples

Query date:

MBS( "SQL.ConvertDateTimeToSQL"; Get(CurrentDate ))

Example result: 2021-04-27

Query time:

MBS( "SQL.ConvertDateTimeToSQL"; Get(CurrentTime ))

Example result: 15:45:26

Query timestamp:

MBS( "SQL.ConvertDateTimeToSQL"; Get(CurrentTimestamp ))

Example result: 2021-04-27T15:45:44

Query with text:

MBS( "SQL.ConvertDateTimeToSQL"; "27.04.2021 15:46:20,123456" )

Example result: 2021-04-27T15:46:20.123456

Query with number:

MBS( "SQL.ConvertDateTimeToSQL"; 63346256456 )

Example result: 2008-05-13T06:20:56

See also

Release notes

  • Version 11.2
    • Added milliseconds for SQL.ConvertDateTimeFromSQL and SQL.ConvertDateTimeToSQL functions.
    • Added SQL.ConvertDateTimeFromSQL and SQL.ConvertDateTimeToSQL functions.

Created 27th April 2021, last changed 3th May 2021


SQL.ConvertDateTimeFromSQL - SQL.Disconnect

Feedback: Report problem or ask question.




Links
MBS Xojo tutorial videos

Start Chat