Foxtable(狐表)用户栏目专家坐堂 → [求助]统计


  共有2109人关注过本帖平板打印复制链接

主题:[求助]统计

帅哥哟,离线,有人找我吗?
江南小镇
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:七尾狐 帖子:1711 积分:11421 威望:0 精华:0 注册:2015/6/22 8:11:00
[求助]统计  发帖心情 Post By:2018/1/14 22:06:00 [只看该作者]

老师,下面代码有什么地方不对吗?
If e.DataCol.name = "年份" OrElse e.DataCol.name = "来源"  OrElse e.DataCol.name = "商品名称"   Then
    If e.DataRow.Isnull("年份") = False AndAlso e.DataRow.Isnull("来源") =False AndAlso e.DataRow.Isnull("商品名称") =  False Then
        Dim filter1 As String = "来源 = '" & e.DataRow("来源") & "'"
        Dim filter2 As String = "来源 = '" & e.DataRow("来源") & "'"
        For i As Integer = 1 To 12
            Dim d As Date = new Date(val(e.DataRow("年份")), i, 1)
            Dim sum As Integer = DataTables("进销存").compute("sum(出库_金额)", filter1 & " and 日期 >= #" & d & "# and 日期 < #" & d.addmonths(1) & "#")
            Dim sum1 As Integer = DataTables("进销存").compute("sum(入库_金额)", filter2 & " and 日期 >= #" & d & "# and 日期 < #" & d.addmonths(1) & "#")
            'e.DataRow("M" & i) = sum
            
            e.DataRow("M" & i) = sum + sum1
        Next
    Else
        For i As Integer = 1 To 12
            e.DataRow("M" & i) = Nothing
        Next
    End If
End If

 回到顶部
总数 16 1 2 下一页