我在用子查询的时候,在子查询中加入where语句,总是报错?
怎么回事呢?
SELECT TabPN.PN, Sum(nz(TabBaseFS.[Q-OK],0)) AS 领料小计, Sum(nz(TabBaseFS.[Q-SC],0)) AS 报废小计
FROM (((TabPN LEFT JOIN TabBaseFG ON TabPN.PN = TabBaseFG.PN) LEFT JOIN TabBaseDGH ON TabPN.PN = TabBaseDGH.PN) LEFT JOIN TabWIPFS ON TabPN.PN = TabWIPFS.PN) LEFT JOIN TabBaseFS ON TabPN.PN = TabBaseFS.PN
WHERE (((TabPN.Dep)="锻压车间") AND ((TabPN.Sta)<>"停产"))
GROUP BY TabPN.PN;
在上面的黑体字中,如果加入where语句 Sum(nz(TabBaseFS.[Q-OK],0)) AS 领料小计 where ([date]=format(now(),"yyyymm") 那么就报错"select字句中包含一个保留字,拼写错误或丢失的参数,或标点符号不正确."