Foxtable(狐表)用户栏目专家坐堂 → [求助]条件判断


  共有30人关注过本帖树形打印复制链接

主题:[求助]条件判断

帅哥哟,离线,有人找我吗?
苏州老街
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:813 积分:5187 威望:0 精华:0 注册:2016/10/19 16:45:00
[求助]条件判断  发帖心情 Post By:2025/3/20 6:45:00 [显示全部帖子]

老师好,我想在下面再增加一个判断条件(房屋主体),房屋主体下有: 
                                                                            一号楼
                                                                            二号楼
                                                                            三号楼


If e.DataCol.Name = "项目" Then
    If e.DataCol.Name = "项目" OrElse  e.DataCol.Name ="抄表日期" Then
        Dim dr1 As DataRow = e.DataTable.Find("项目='" & e.NewValue & "' and 抄表日期 is not null and _sortkey <" & e.DataRow("_sortkey"), "_sortkey desc")
        Dim sl As Double
        Dim st As Decimal=0
        If dr1 IsNot Nothing Then
            sl = dr1("总表_本期读数")
            st  = dr1("_sortkey")
            e.DataRow("总表_上期读数") = sl
        End If
        Dim dr2 As DataRow = e.DataTable.find("项目='" & e.NewValue & "' and 购气_数量 is not null and _sortkey <" & e.DataRow("_sortkey") & " and _sortkey > " & st, "_sortkey desc")
        If dr2 IsNot Nothing Then
            e.DataRow("总表_上期读数") = sl + dr2("购气_数量")
        End If
    End If
End If

 回到顶部