摘要:
在T-SQL中经常会用到与DateTime相关的函数,现将常用函数做一下汇总,以备忘。SQL DAY() –MONTH( ) – YEAR()DAY('2008-09-30') = 30MONTH('2008-09-30') = 9YEAR('2008-09-30') = 2008SQL DATEPART()DATEPART(day, '2008-09-30 11:35:00.1234567') = 30DATEPART(month, '2008-09-30 11:35:00.1234567') =9DATEPAR 阅读全文