以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]取值问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=17031)

--  作者:pyh6918
--  发布时间:2012/3/1 15:12:00
--  [求助]取值问题

请各位老师帮忙看看,用数值做条件的取值问题,这样为什么不行:

 

For Each dr As Row In Tables("数据").Rows
    Dim h As DataRow=DataTables("标准").Find("下限>=" & dr("金额") & "and 上限<" & dr("金额"))
    If h IsNot Nothing Then \'如果找到的话
        dr("标准")=h("标准")
    End If
Next

 

这样能取到值:

For Each dr As Row In Tables("数据").Rows
    Dim h As DataRow=DataTables("标准").Find("下限>=" & dr("金额"))
    If h IsNot Nothing Then \'如果找到的话
        dr("标准")=h("标准")
    End If
Next

难到end不能用吗?


--  作者:pyh6918
--  发布时间:2012/3/1 16:05:00
--  
老大帮忙给看一下
--  作者:狐狸爸爸
--  发布时间:2012/3/1 16:13:00
--  
For Each dr As Row In Tables("数据").Rows
       Dim h As DataRow=DataTables("标准").Find("下限 <=" & dr("金额") & "and 上限>" & dr("金额"))
        If h IsNot Nothing Then \'如果找到的话
             dr("标准")=h("标准")
        End If
Next
--  作者:pyh6918
--  发布时间:2012/3/1 17:09:00
--  

谢老大,我真想撞墙。这么菜的问题都要麻烦老大,还费了我一下午时间。就没转过这个弯来!!!!!!!!