|
翻了下你原先的查询语句,发现有问题,附上一览表的修改结果:
- SELECT 工程名称.gcmc, 工程名称.jsdw, 工程名称.sgdw, CDbl(Nz(年度![jsjen])) AS njsje, CDbl(Nz(年度![xxsen])) AS nxxse, CDbl(Nz(年度![jsjen]))+CDbl(Nz(年度![xxsen])) AS njssr, CDbl(Nz(年度![qrsrn])) AS nqrsr, CDbl(Nz(年度![gccbn])) AS nqqcb, CDbl(Nz(年度![fbcbn])) AS nfbcb, CDbl(Nz(年度![clcbn])) AS nclcb, CDbl(Nz(年度![qtcbn])) AS nqtcb, CDbl(Nz(年度![fyjen])) AS nfy, CDbl(Nz(累计![jsjez])) AS zjsje, CDbl(Nz(累计![xxsez])) AS zxxse, CDbl(Nz(累计![jsjez]))+CDbl(Nz(累计![xxsez])) AS zjssr, CDbl(Nz(累计![qrsrz])) AS zqrsr, CDbl(Nz(累计![jsjez]))-CDbl(Nz(累计![qrsrz])) AS wjsr, CDbl(Nz(累计![sjskz])) AS zsk, -CDbl(Nz(累计![sjskz]))+CDbl(Nz(累计![xxsez]))+CDbl(Nz(累计![jsjez])) AS ysk, CDbl(Nz(累计![gccbz])) AS zqqcb, CDbl(Nz(累计![fbcbz])) AS zfbcb, CDbl(Nz(累计![clcbz])) AS zclcb, CDbl(Nz(累计![qtcbz])) AS zqtcb, CDbl(Nz(累计![fyjez])) AS zfy, CDbl(Nz(累计![jxsez])) AS zjxs, CDbl(Nz(累计![sjz])) AS zfjs, CDbl(Nz(累计![yysz])) AS zqqsf, CDbl(Nz(累计![sjz]))+CDbl(Nz(累计![yysz])) AS zsj
- FROM (工程名称 LEFT JOIN 累计 ON 工程名称.gcmc = 累计.gcmc) LEFT JOIN 年度 ON 累计.gcmc = 年度.gcmc
- ORDER BY 工程名称.sgdw;
复制代码
说明:Nz返回的是文本,必须要转为数值型才能计算。所以只要使用了Nz的sum都有问题。 |
|