老师好,我想在“房屋主体”后面再加一个统计条件“单间名称”
If e.DataCol.name = "年" OrElse e.DataCol.name = "房屋主体" Then
If e.DataRow.Isnull("年") = False AndAlso e.DataRow.Isnull("房屋主体") = False Then
Dim filter1 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) & "#")
用法不都一样吗,使用and连接多个条件即可:http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=196048&skin=0
老师,这个统计条件“单间名称”要加到下面代码中吗?
If e.DataCol.name = "年" OrElse e.DataCol.name = "房屋主体" Then
If e.DataRow.Isnull("年") = False AndAlso e.DataRow.Isnull("房屋主体") = False Then
Dim filter1 As String = "名称_房屋主体 = '" & e.DataRow("房屋主体") & "'"
老师,没有改好,标出的是原来的代码,没标出的代码该不好。
'If e.DataCol.name = "年" OrElse e.DataCol.name = "单间名称" Then
'If e.DataRow.Isnull("年") = False AndAlso e.DataRow.Isnull("单间名称") = False Then
'Dim filter1 As String = "名称_单间名称 = '" & e.DataRow("单间名称") & "'"
If e.DataCol.name = "年" OrElse e.DataCol.name = "房屋主体" OrElse e.DataCol.name = "单间名称" Then
If e.DataRow.Isnull("年") = False AndAlso e.DataRow.Isnull("房屋主体") AndAlso e.DataRow.Isnull("单间名称") = False Then
Dim filter1 As String = "名称_房屋主体 = '" & e.DataRow("房屋主体") And "名称_单间名称 = '" & e.DataRow("单间名称") & "'"
老师,是这个地方面
Dim filter1 As String = "名称_房屋主体 = '" & e.DataRow("房屋主体") And "名称_单间名称 = '" & e.DataRow("单间名称") & "'"
老师,去掉双引号报错

此主题相关图片如下:2025-03-17 12 19 54.png