以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助] 查询表的筛选  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=92979)

--  作者:baiheinet
--  发布时间:2016/11/17 15:57:00
--  [求助] 查询表的筛选
\'用SQL语句生成临时表
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText = "Select Distinct  DocumentType,Delivereddate,DocumentNo Fr om {Outgoing_Transmittal} Where DocumentType=\'QUALITY PROCEDURE\' AND Delivereddate >= \'11/5/2016\' AND Delivereddate <= \'11/12/2016\'"
Dim dt As DataTable = cmd.ExecuteReader()
Dim cmd2 As New SQLCommand
cmd2.C
cmd2.CommandText = "Select  DocumentType,Delivereddate,DocumentNo Fr om {Outgoing_Transmittal} Where DocumentType=\'QUALITY PROCEDURE\' AND Delivereddate < \'11/5/2016\'"
Dim dt2 As DataTable = cmd.ExecuteReader()
‘关联筛选显示结果
Tables("dt").RelationFilter("DocumentNo", dt2, "DocumentNo", True)

[此贴子已经被作者于2016/11/17 15:57:56编辑过]

--  作者:baiheinet
--  发布时间:2016/11/17 15:59:00
--  
Tables("dt") 和 dt怎么能沟通
--  作者:有点蓝
--  发布时间:2016/11/17 17:03:00
--  
这样的临时表没有办法这样用。