繁体   English   中英

SQL Update代码将数据从一个单元格移动到另一个单元格

[英]SQL Update code to move data from one cell to another

我在Visual Basic中对sql服务器具有以下代码。 部分代码:

Comments = ReasonNotDone + ' " & Today.AddDays(-1).ToShortDateString & "', ReasonNotDone = '' WHERE IsDone = 'False' OR IsDone IS NULL AND ActiveDate = '" & Now.AddDays(-1).ToShortDateString & "'"

此代码正确吗? Comments单元格设置为日期,但是未添加来自ReasonNotDone的数据。 但是,来自ReasonNotDone的数据被设置为'' 在得到Comments的值之前, ReasonNotDone的数据是否可能设置为''

除了我作为注释发布的SQL语法错误之外,您还关注着

ReasonNotDone = '' WHERE IsDone = 'False' OR IsDone IS NULL AND ActiveDate = '" & Now.AddDays(-1).ToShortDateString & "'"

以及您打算在哪里补充其他内容

 ReasonNotDone + **' " & Today.AddDays(-1).ToShortDateString & "'**

您的SQL将像这样结束

 ... AND ActiveDate = '4/4/2014''4/4/2014'

它完全弄乱了语法。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM