以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]查询表生成错误 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=61662) |
-- 作者:a87918021 -- 发布时间:2014/12/16 21:03:00 -- [求助]查询表生成错误 查询表生成错误,求大神指导。我是SQLtable加载到窗口中的表,要把筛选出来的两个表按第一列编号合并成一个表。生成第三个表,不需要在编辑。 |
-- 作者:有点甜 -- 发布时间:2014/12/16 21:22:00 -- Dim filter As String filter = iif(Tables(e.Form.name & "_table1").Filter>"", Tables(e.Form.name & "_table1").Filter,"1=1") Dim sql As String = "select * from {表A} where " & filter filter = iif(Tables(e.Form.name & "_table2").Filter>"", Tables(e.Form.name & "_table2").Filter,"1=1") sql = "select a.第二列, b.第二列 from (" & sql & ") a inner join (select * from {表B} where " & filter & ") b on a.第一列 = b.第一列" msgbox(sql) Tables(e.Form.name & "_table3").Fill(sql, True) |