检查空白列并更新访问查询中的表 [英] checking for a blank column and updating the table in access query
本文介绍了检查空白列并更新访问查询中的表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人,
我正在通过vb应用程序更新Access db中的表,如下所示:
Dear All,
I am updating the table in access db through vb application as below:
Cnn.Execute ("Update GRSEXPORT Set [Serial Numbers]=[Serial Numbers]+';'+ '" & rs.Fields("Serial Numbers") & _
"',[Sell Through Quantity]=[Sell Through Quantity]+" & Val(rs.Fields("Sell Through Quantity") & "") & " Where" & SQL)
在这里我设置序列号=序列号+'';''
问题是,即使序列号"列为空,它也会更新表中的;"(分号).如果序列号列为空白,我希望更新空白列..
任何帮助将不胜感激.
问候,
Here I am setting the Serial Numbers = Serial Numbers + '';''
The problem is that even if the Serial Numbers column is blank, its updating '';''(semicolon) in the table. I want blank column to be updated if the Serial Numbers column is blank..
Any help would be greatly appreciated.
Regards,
推荐答案
如果我理解正确,则希望将空白值更新为[Serial Numbers].换句话说,将不会进行任何更新.
可能将您的查询更改为此.
If I understand it right, you want a blank value to be updated to [Serial Numbers] when it is blank. In other words, no update will be made.
Probably change your query to this.
Update GRSEXPORT Set [Serial Numbers]=[Serial Numbers]+';'+ ' WHERE [Serial Numbers] <> '' OR [Serial Numbers] <> NULL
仅添加;如果序列号不为空.一个简单的if-then语句就可以解决这个问题.
Only add the ; if the serial number is not blank. A simple if-then statement should take care of it.
这篇关于检查空白列并更新访问查询中的表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文