SELECT DATEADD(mm, DATEDIFF(mm,0,getdate()), 0)
SELECT DATEDIFF(wk,0,getdate())
SELECT DATEADD(yy, DATEDIFF(yy,0,getdate()), 0)
SELECT DATEADD(qq, DATEDIFF(qq,0,getdate()), 0)
SELECT DATEADD(dd, DATEDIFF(dd,0,getdate()), 0)
SELECT DATEDIFF(s,(SELECT DATEDIFF(dd,0,getdate())),getdate())
SELECT DATEDIFF(minute,(SELECT DATEDIFF(dd,0,getdate())),getdate())
SELECT dateadd(ms,-3,DATEADD(mm, DATEDIFF(mm,0,getdate()), 0))
SELECT DATEADD(mm, DATEDIFF(m,0,getdate())+1, 0)
select datediff(w,0,getdate())
SELECT getdate(),DATEADD(dd, DATEDIFF(dd,0,getdate()), 0)
select datename(m,getdate())
select datediff(day,'2007-'+cast(datename(m,getdate()) as varchar)+'-20' ,'2007-'+cast(datename(m,getdate())+1 as varchar)+'-20')
select datediff(mm,0,getdate())
SELECT case day(dateadd(mm, 2, dateadd(ms,-3,DATEADD(yy, DATEDIFF(yy,0,getdate()), 0)))) when 28 then '平年' else '闰年' end
declare @m tinyint,@time smalldatetime
select @m=month(getdate())
select @m=case when @m between 1 and 3 then 1
when @m between 4 and 6 then 4
when @m between 7 and 9 then 7
else 10 end
select @time=datename(year,getdate())+'-'+convert(varchar(10),@m)+'-01'
select datediff(day,@time,dateadd(mm,3,@time))