以文本方式查看主题

-  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=23539)

--  作者:yyzlxc
--  发布时间:2012/9/12 9:17:00
--  [求助]代码出错(已解决)

一段代码,填充分月数据,运行后提示“表达式中有语法错误”,请各位老师帮助看看,问题在哪里,如何修改,谢谢!!

 

Dim ny1,yf As String
For Each dr1 As DataRow In DataTables("销售工效分月分析").DataRows
    For j As Integer = 1 To i
        If j <= 9
            yf = 0 & j
        Else
            yf = j
        End If
        ny1 = nf & "-" & yf
       
        If dr1.IsNull("厂家")  Then
            dr1(ny1 & "_销售收入") = Nothing
        Else
            Dim pr1 As Double = DataTables("xsmx").Compute("Sum(销售收入)","[年月] =\'" & ny1 & "\',[单位] =\'" & dr1("单位") & "\',[客户全称] =\'" & dr1("厂家") & "\'")
            dr1(ny1 & "_销售收入") = pr1
        End If

    Next
Next

 

 

 


图片点击可在新窗口打开查看此主题相关图片如下:d.jpg
图片点击可在新窗口打开查看
[此贴子已经被作者于2012-9-12 10:35:51编辑过]

--  作者:czy
--  发布时间:2012/9/12 9:50:00
--  
Dim pr1 As Double = DataTables("xsmx").Compute("Sum(销售收入)","[年月] =\'" & ny1 & "\' and [单位] =\'" & dr1("单位") & "\' and [客户全称] =\'" & dr1("厂家") & "\'")

--  作者:yyzlxc
--  发布时间:2012/9/12 10:35:00
--  

谢谢CZY老师的指教,问题已解决,再次感谢!!