第1个回答 2009-03-05
去查下datedadd或者datediff函数的用法
第2个回答 2009-03-05
money=month(dateadd(m,-1,datetime))
year=year(dateadd(m,-1,datetime))
第3个回答 2009-03-05
select month(dateadd(m,-1,getdate()))
select year(dateadd(m,-1,getdate()))
第4个回答 2009-03-05
if month(datetime)=1 then
yy=year(datediff(y,1,datetime))
mm=12
else
yy=year(datetime)
mm=month(datediff(m,1,datetime)
end if本回答被提问者采纳