日期:2014-05-18 浏览次数:20672 次
SELECT YEAR('2012-11-01')+3
------解决方案--------------------
select CONVERT(char(5),dateadd(year, 3 ,'2012-11-01'),120)
楼主日期格式错误了,应该是120的情况下才是2015
------解决方案--------------------
select convert(char(10),getdate(),110),
convert(char(5),getdate(),110),
convert(char(10),getdate(),120),
convert(char(5),getdate(),120)
/*
---------- ----- ---------- -----
03-13-2012 03-13 2012-03-13 03-13
*/
------解决方案--------------------
select year('2011-4-3')+3