Foxtable(狐表)用户栏目专家坐堂 → 变量如何运算


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

主题:变量如何运算

帅哥哟,离线,有人找我吗?
有点甜
  11楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/4/30 9:12:00 [显示全部帖子]

 回复24楼,包裹一下

 

If e.Row.Index > 0 Then
    If Tables("煤焦油油耗跟踪表").Current.IsNull("日期") Or Tables("煤焦油油耗跟踪表").Current.IsNull("读数时间") Then
        MessageBox.Show("没有输入日期或读数时间")
    Else
        Dim tp1 As TimeSpan = e.Row("日期")-e.Table.Rows(e.Row.Index-1)("日期")
        Dim tp As TimeSpan = e.Row("读数时间")-e.Table.Rows(e.Row.Index-1)("读数时间")
        Dim tp3 As TimeSpan = tp1+tp
        e.Row("间隔小时数")= tp3.Days & "天" & tp3.Hours & "小时" & tp3.Minutes & "分"
    End If
   
    If Tables("煤焦油油耗跟踪表").Current.IsNull("油表读数") Then
        MessageBox.Show("没有输入油表读数")
    Else
        e.Row("读数差") = e.Row("油表读数")-e.Table.Rows(e.Row.Index-1)("油表读数")
    End If
   
    Dim tp4 As TimeSpan = e.Row("日期")-e.Table.Rows(e.Row.Index-1)("日期")
    Dim tp5 As TimeSpan = e.Row("读数时间")-e.Table.Rows(e.Row.Index-1)("读数时间")
    Dim tp6 As TimeSpan = tp4+tp5
    Dim sz As Double = tp6.TotalHours
    Dim s1 As Double  = e.Row("油表读数")-e.Table.Rows(e.Row.Index-1)("油表读数")
    e.Row("每小时油耗容量") = s1\sz
End If


 回到顶部
总数 12 上一页 1 2