|
sql2 = "SELECT linshi.成本组, Sum(linshi.面积) AS 总面积, Sum(linshi.金额) AS 总金额, (Sum(linshi.金额)/Sum(linshi.面积)) AS 单价" & _
"FROM (SELECT bajiechz.面积, bajiechz.金额, bajiechz.成本组 FROM bajiechz where 账务日期=#" & ysrqsy & "# union all" & _
"SELECT bashengcmj.面积, bashengcmj.金额, bashengcmj.成本组 FROM bashengcmj where 账务日期=dateadd('m',1,#" & ysrqsy & "#) and 类别='收') linshi GROUP BY 成本组"
Set rs = New ADODB.Recordset
rs.Open sql2, CurrentProject.Connection, adOpenKeyset, adLockPessimistic
各位大哥,帮忙看看上面的的ADO执行SQL语句有什么问题,执行到rs.Open sql2提示"select 子句中包含一个保留字,拼写错误或丢失的参数,或标点符号不正确",谢谢各位
|
|