Contents Index Using unambiguous dates and times DATETIME data type [Date and Time]

ASA SQL Reference
  SQL Data Types
    Date and time data types

DATE data type [Date and Time]


Function 

A calendar date, such as a year, month and day.

Syntax 

DATE

Usage 

The year can be from the year 0001 to 9999. The minimum date in Adaptive Server Anywhere is 0001-01-01 00:00:00.

For historical reasons, a DATE column can also contain an hour and minute if the TRUNCATE_DATE_VALUES option is set to OFF. The TIMESTAMP data type is recommended for anything with hours and minutes.

The format in which DATE values are retrieved by applications is controlled by the DATE_FORMAT setting. For example, a date value representing the 19th of July, 2003 may be returned to an application as 2003/07/19, as Jul 19, 2003, or as one of a number of other possibilities.

The way in which a string is interpreted by the database server as a date is controlled by the DATE_ORDER option. For example, depending on the DATE_ORDER setting, a value of 02/05/2002 supplied by an application for a DATE value may be interpreted in the database as the 2nd of May or the 5th of February.

A DATE value requires 4 bytes of storage.

Standards and compatibility 
See also 

DATE_FORMAT option [compatibility]

DATE_ORDER option [compatibility]

DATETIME data type [Date and Time]

SMALLDATETIME data type [Date and Time]

TIMESTAMP data type [Date and Time]

TRUNCATE_DATE_VALUES option [database]


Contents Index Using unambiguous dates and times DATETIME data type [Date and Time]