日期:2014-05-17 浏览次数:20702 次
update Card set card_enddate = dateadd(day,3,convert(varchar(10),card_jlrq,120)) where card_no ='00000004'
------解决方案--------------------
create table Cards (card_no varchar(15), card_jlrq datetime, card_enddate datetime) insert into Cards select '00000004','2012-7-27 13:39:32', '2013-7-27' update Cards set card_enddate=cast(dateadd(yy,2,card_jlrq) as date) where card_no ='00000004' select * from Cards /* card_no card_jlrq card_enddate --------------- ----------------------- ----------------------- 00000004 2012-07-27 13:39:32 2014-07-27 00:00:00 (1 row(s) affected) */