reference:http://www.cnblogs.com/coconut_zhang/archive/2009/02/02/1382598.html http://blog.itpub.net/14766526/viewspace-1156100/ select GETDATE() as '当前日期',DateName(year,GetDate()) as '年',DateName(month,GetDate()) as '月',DateName(day,GetDate()) as '日…
select day(createtime) from life_unite_product --取时间字段的天值 select month(createtime) from life_unite_product --取时间字段的月值 select year(createtime) from life_unite_product --取时间字段的年值 select datepart(yy,createtime) from life_unite_product --取时间…