例1,
2> select DATENAME(day, '2002-09-30 11:35:00')
3> GO
------------------------------
30
(1 rows affected)
1>
例2,
3> select DATENAME(month, '2002-09-30 11:35:00')
4> GO
------------------------------
September
(1 rows affected)
1>
例3,
3> select DATENAME(year, '2002-09-30 11:35:00')
4> GO
------------------------------
2002
(1 rows affected)
例4,
2> select DATENAME(hour, '2002-09-30 11:35:00')
3> GO
------------------------------
11
(1 rows affected)
1>
例5,
3> select DATENAME(minute, '2002-09-30 11:35:00')
4> GO
------------------------------
35
(1 rows affected)
1>
例6,
3> select DATENAME(second, '2002-09-30 11:35:00')
4> GO
------------------------------
0
(1 rows affected)
1>
例7,
3> select DATENAME(quarter, '2002-09-30 11:35:00')
4> GO
------------------------------
3
(1 rows affected)