Skip to main content
Previous section


Set the default date format for the SQL TO_DATE() function.


[SQL]    TODATEDefaultFormat=n

n is any string in a format appropriate for the TO_DATE() function. The default string is DD MON YYYY.


The value n provides the format string that the SQL TO_DATE() function uses when TO_DATE() is called without a format specified.


The following is an example:

Copy code to clipboard

And the following another example:

Copy code to clipboard

For more examples and an in-depth discussion about valid date strings, see the Format section of the “TO_DATE” reference page in InterSystems RSQL Reference.

Changing This Parameter

On the SQL page of the Management Portal (System Administration > Configuration > SQL and Object Settings > SQL), in the TO_DATE default format field, enter a valid format string.

To set the desired value for TODATEDefaultFormat from the Terminal, use the SetOption(“ToDateDefaultFormat”)Opens in a new window method of the %SYSTEM.SQL.UtilOpens in a new window class. See the class reference for details.

You can also change TODATEDefaultFormat with the Config.SQLOpens in a new window class (as described in the class reference) or by editing the CPF in a text editor (as described in the Editing the Active CPF section of the “Introduction to the Configuration Parameter File” chapter in this book).

FeedbackOpens in a new window