以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  表达式列 作为筛选条件,应该怎么写啊?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=135066)

--  作者:guosheng
--  发布时间:2019/5/16 10:13:00
--  表达式列 作为筛选条件,应该怎么写啊?

Dim drs As List(of DataRow) = DataTables("专项工作过程记录表").SQLSelect("等级=\'二级\' and 一级编号=" & Parent(专项_专项记录).一级编号)

显示parent没有定义啊?      


--  作者:y2287958
--  发布时间:2019/5/16 10:28:00
--  
SQLSelect不能用表达式列
[此贴子已经被作者于2019/5/16 10:28:26编辑过]

--  作者:guosheng
--  发布时间:2019/5/16 10:41:00
--  
sqlselcet将表达式列作为筛选条件,有变通方式吗?
--  作者:有点甜
--  发布时间:2019/5/16 12:58:00
--  

如果在datacolchanged事件

 

Dim drs As List(of DataRow) = DataTables("专项工作过程记录表").SQLSelect("等级=\'二级\' and 一级编号=\'" & e.datarow.getparentrow("专项_专项记录")("一级编号") & "\'" )

 

具体问题,做一个例子发上来测试。


--  作者:guosheng
--  发布时间:2019/5/16 14:30:00
--  

Dim cr As Row = Tables("专项工作执行情况表").current.datarow

能否找到cr对应某个 “子表”的关联行drs吗(通过后台数据库查询有办法取到drs吗,而是不是通过加载到本地的datatable中查询)?谢谢


--  作者:有点甜
--  发布时间:2019/5/16 15:19:00
--  

直接查询即可,如

 

Dim drs As List(of DataRow) = DataTables("专项工作过程记录表").SQLSelect("等级=\'二级\' and 一级编号=\'" & Tables("专项工作执行情况表").current("一级编号") & "\'" )