Contents Index Date and time data types Transact-SQL compatibility of string-to-date/time conversions

ASA SQL Reference
  SQL Data Types
    Date and time data types

Sending dates and times to the database


Dates and times may be sent to the database in one of the following ways:

When a time is sent to the database as a string (for the TIME data type) or as part of a string (for TIMESTAMP or DATE data types), the hours, minutes, and seconds must be separated by colons in the format hh:mm:ss.sss, but can appear anywhere in the string. The following are valid and unambiguous strings for specifying times:

21:35 -- 24 hour clock if no am or pm specified
10:00pm -- pm specified, so interpreted as 12 hour clock
10:00 -- 10:00am in the absence of pm
10:23:32.234 -- seconds and fractions of a second included

When a date is sent to the database as a string, conversion to a date is automatic. The string can be supplied in one of two ways:


Transact-SQL compatibility of string-to-date/time conversions

Contents Index Date and time data types Transact-SQL compatibility of string-to-date/time conversions