时间:2021-07-01 10:21:17 帮助过:25人阅读
declare @aa datetime
declare @bb datetime
SET @aa=GETDATE()
print @aa
set @bb=CONVERT(datetime,‘2017 04 29 15:00:00‘)
print @bb
print datediff(day, @aa,@bb)
print datediff(hour, @aa,@bb)
print datediff(minute , @aa,@bb)
print datediff(second , @aa,@bb)
==============输出内容====================
04 29 2017 2:58PM
04 29 2017 3:00PM
0
1
2
71
sqlserver日期操作
标签:输出 set ted nbsp print == sql second get