注册 登录
编程论坛 SQL Server论坛

利用时间函数修改数据库中的时间节点

lyk12345 发布于 2016-09-04 11:21, 1709 次点击
declare @code varchar(1)
set @code = '0-20150809318'
select BeginTime from worksheet where code = @code and StateType = '机修上线'
select * from dba_para where para_code = @code
update dba_para set para_time_end = dateadd(n,1,(select BeginTime from worksheet where code = @code and StateType = '机修上线')) where para_code = @code and para_time_end != ''
select * from dba_para where para_code = @code
我想把机修上线的时间节点往前提前但是不行啊请大神指教
1 回复
#2
mywisdom882016-09-04 22:33
给出你表的源数据,然后,你最后要得到的数据,这样,别人更加能看明白你要做什么。
1