以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]SQL语句求助 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=70861) |
-- 作者:huangfanzi -- 发布时间:2015/6/30 13:04:00 -- [求助]SQL语句求助 下面代码中,where条件后用的是变量,目前的写法通不过,应该如何写,谢谢! Dim txt As String = e.Form.Controls("TextBox1").Text Dim flt As String Dim tbl As Table = Tables("供应商名录入弹窗_Table1") If txt = "" Then Tables("供应商名录入弹窗_Table1").Fill("Sel ect 地域,公司,代码 From {供应商} Where [_Identify] Is Null","ShcsErpSql",True) Else txt = "\'%" & txt & "%\'" flt = "公司 Like " & txt & " Or 地域 Like " & txt & " Or 代码 Like " & txt Tables("供应商名录入弹窗_Table1").Fill("Sel ect 地域,公司,代码 From {供应商} Where" & flt,"ShcsErpSql",True) End If
|
-- 作者:huangfanzi -- 发布时间:2015/6/30 13:35:00 -- 搞定了,原来是书写不规范,字段名没加中括号 flt = "[公司] Like " & txt & " Or [地域] Like " & txt & " Or [代码] Like " & txt
|