Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 17 » UltraLite - Database Management and Developer Guide » UltraLite database reference » UltraLite options

UltraLite date_order creation option

Specify the default order of date parts when interpreting a date string.

Syntax
date_order=value
Allowed values

MDY, YMD, DMY

Default

YMD (this corresponds to ISO date format specifications)

Remarks

For Android devices, you can use Connection.setOption(OPTION_DATE_ORDER, value) as an alternative to setting this creation option.

The default order for year, month, and day corresponds to the ISO 8601 date format. For example, "06-01-07" is interpreted as January 7, 2006.

You can specify a different order for the interpretation of date parts. For example, if "06-01-07" represents June 1, 2007 then specify "MDY" for the date order.

You can only specify the date order for a new database. Once the database has been created, you cannot change the date order.

From SQL Central, you can set the date order in any wizard that creates a database. On the New database creation parameters page, click the Date Order option.

From a client application, set this option as one of the creation options for the CreateDatabase method on the DatabaseManager/ULDatabaseManager class.

Example

Different values determine how the date 10/11/12 is interpreted:

Date order Interpretation
MDY October 11 2012
YMD November 12 2010
DMY November 10 2012

Use the nearest_century option to control the interpretation of two-digit years in string-to-date conversions.

The following SQL query returns 2010-11-12 using the default date_order and nearest_century settings.

SELECT CAST( CAST( '10/11/12' AS DATE ) AS VARCHAR(15) );