sql datepart函数
例1,
3> select DATEPART(day, '2002-09-30 11:35:00')
4> GO
-----------
30
(1 rows affected)
1>
例2,
3> select DATEPART(month, '2002-09-30 11:35:00')
4> GO
-----------
9
(1 rows affected)
例3,
2> select DATEPART(year, '2002-09-30 11:35:00')
3> GO
-----------
2002
(1 rows affected)