May 2006
Intermediate to advanced
536 pages
15h 13m
English
SQL Server supports two date and time–related datatypes: DATETIME and SMALLDATETIME. Most of the discussions in this chapter are relevant to both types, but for simplicity’s sake, I will typically refer to just DATETIME. When discussing aspects that are specific to one of the types, I’ll refer to DATETIME and SMALLDATETIME separately.
DATETIME is one of the most frequently used datatypes and one of the most problematic ones, if not the most problematic. There are misconceptions regarding the storage format of DATETIME, many issues related to the different representation conventions, and many interesting querying problems related ...