The date parts, the abbreviations recognized by Adaptive Server, and the acceptable values are:
Date part |
Abbreviation |
Values |
---|---|---|
yy |
1753 – 9999 (datetime) 1753 – 2079 (smalldatetime) 0001 – 9999 (bigdatetime) |
|
quarter |
1 – 4 |
|
mm |
1 – 12 |
|
week |
wk |
1 – 54 |
dd |
1 – 31 |
|
dayofyear |
dy |
1 – 366 |
weekday |
dw |
1 – 7 (Sun. – Sat.) |
hour |
hh |
0 – 23 |
minute |
mi |
0 – 59 |
second |
ss |
0 – 59 |
millisecond |
ms |
0 – 999 |
microseconds |
us |
0-999999 |
When you enter a year as two digits (yy):
Numbers less than 50 are interpreted as 20yy.
For example, 01
is 2001, 32
is
2032, and 49
is 2049.
Numbers equal to or greater than 50 are interpreted
as 19yy. For example, 50
is
1950, 74
is 1974, and 99
is
1999.
For datetime, smalldatetime and time values milliseconds can be preceded either with a colon or a period. If preceded by a colon, the number means thousandths of a second. If preceded by a period, a single digit means tenths of a second, two digits mean hundredths of a second, and three digits mean thousandths of a second. For example, “12:30:20:1” means twenty and one-thousandth of a second past 12:30; “12:30:20.1” means twenty and one-tenth of a second past 12:30. Adaptive Server may round or truncate millisecond values when inserting datetime or time data, as these datatypes have a granularity of 1/300th of a second rather than 1/1000th of a second. You can use the time datatype for time information.
For bigdatetime and bigtime time values, microseconds must be preceded by a decimal point and represent fractional seconds.