4 个解决方案
#1
使用dateadd加天啊,参考
http://msdn.microsoft.com/zh-cn/library/ms186819.aspx
http://msdn.microsoft.com/zh-cn/library/ms186819.aspx
#2
update tab set time2=dateadd(day,5+abs(checksum(newid()))%(7-5+1),time2);
貌似用字符串的话有点复杂。。
#3
用字符串的话有点复杂?数据类型是字符串?convert加个参数转化。
#4
update tab set time2 = time1+(select 5+abs(checksum(newid()))%(7-5+1))+(select convert(char(12),time2,114) value)
where time2<time1 or time2>time3
谢谢各位的帮忙了,我已经写出来了,虽然有点麻烦
where time2<time1 or time2>time3
谢谢各位的帮忙了,我已经写出来了,虽然有点麻烦
#1
使用dateadd加天啊,参考
http://msdn.microsoft.com/zh-cn/library/ms186819.aspx
http://msdn.microsoft.com/zh-cn/library/ms186819.aspx
#2
update tab set time2=dateadd(day,5+abs(checksum(newid()))%(7-5+1),time2);
貌似用字符串的话有点复杂。。
#3
用字符串的话有点复杂?数据类型是字符串?convert加个参数转化。
#4
update tab set time2 = time1+(select 5+abs(checksum(newid()))%(7-5+1))+(select convert(char(12),time2,114) value)
where time2<time1 or time2>time3
谢谢各位的帮忙了,我已经写出来了,虽然有点麻烦
where time2<time1 or time2>time3
谢谢各位的帮忙了,我已经写出来了,虽然有点麻烦