1. 程式人生 > >sql日期查詢

sql日期查詢

nbsp 當前 from diff ediff sel 當前日期 sele bsp

select getdate()  
select dateadd(year,-1,getdate())  
select datediff(day,getdate(),dateadd(day,2,getdate())  ) 
Select datepart(month, dateadd(month,1,getdate())) 
Select datepart(hour, dateadd(month,1,getdate()))   
Select datename(weekday, getdate())   
select 當前日期=convert(varchar(4),getdate
(),20),當前時間=convert(varchar(8),getdate(),114) select datename(hh,getdate()) select 本年第多少周=datename(week,getdate()),今天是周幾=datename(weekday,getdate()) select*from AAE_GroupPlan select datepart(year,getdate())+0

sql日期查詢