|
请教?在VBA中写SQL语句长度有无限制?在下面的
gzsql1 = "SELECT archives.grid AS 编号, archives.grname AS 姓名, Sum(jgpj.[shu]) AS 积分, round(Sum(jgpj.[shu]*gjb.[x01])) AS 工资 into [gz1] FROM gjb RIGHT JOIN (archives RIGHT JOIN jgpj ON archives.[grid]= jgpj.[grid]) ON gjb.[id] = jgpj.[proid] where jgpj.shg=False and archives.zzf=true and (jgpj.dhdate) between" & rq1 & "and" & rq2 & "and jgpj.grname='" & selegr.Value & "'group by archives.grid,archives.grname;"
这个字串中正常,但在archives.grname AS 姓名 之后,加入 jgpj.[dhdate]就会出现错误
“运行时错误 3122,试图运行查询中不包含作为合计函数的一部分的特定表达式‘日期’”
[em01][em01] |
|