SQL语句在accessVB代码中提示“缺少语句结束”高亮在sum(Nz(X.计数器重量)的sum处,请高手帮忙纠正一下!
strsql="SELECTX.种类,X.供应商,X.采购交接表单号,X.日期,X.车顺序,Sum(X.采购数量)AS采购总数,Sum(X.采购重量)AS采购总重,Sum...
strsql = "SELECT X.种类,X.供应商,X.采购交接表单号,X.日期,X.车顺序,Sum(X.采购数量) AS 采购总数,Sum(X.采购重量) AS 采购总重,Sum(Nz(X.计数器数量) + Nz(X.附加数量)) AS 计数器总数, _
Sum(Nz(X.计数器重量) + Nz(X.附加重量) + Nz(X.鸭翅重量) + Nz(X.鸭掌重量)) AS 计数器总重,(计数器总重/采购总重) AS 计数器成数,Sum(A.产品数量) AS 入库总数,Sum(A.产品重量) AS 产品总重,
Sum(A.油肺掌翅) AS 油肺掌翅,(Sum(A.产品重量) + Sum(A.油肺掌翅))/采购总重 AS 入库成数 FROM 车次明细数据B as X,(SELECT B.成品入库单编号,Sum(iif((B.中类='52' or B.中类='53'),B.数量,0)) AS 产品数量, _
Sum(iif((B.中类= '52' or B.中类= '53' or B.产品编号='3423019' or B.产品编号='3423030' or B.产品编号='3423040' or B.产品编号='3423042'),B.重量,0)) AS 产品重量, _
Sum(iif((B.产品编号='3423007' or B.产品编号='3423011' or B.产品编号='3423012' or B.产品编号='3423006' or B.产品编号='3433012' or B.产品编号='3433013' or B.产品编号='3433018' or B.产品编号='3433006'),B.重量,0)) AS 油肺掌翅 FROM 入库明细表 AS B _
WHERE B.作废='N' GROUP BY B.成品入库单编号) AS A WHERE ((A.成品入库单编号=X.成品入库单编号) AND (X.日期= # " & Da & "#)) GROUP BY X.种类,X.供应商,X.采购交接表单号,X.日期,X.车顺序 ORDER BY X.日期 DESC,X.车顺序"
初学,语句写的很乱,请多指教! 展开
Sum(Nz(X.计数器重量) + Nz(X.附加重量) + Nz(X.鸭翅重量) + Nz(X.鸭掌重量)) AS 计数器总重,(计数器总重/采购总重) AS 计数器成数,Sum(A.产品数量) AS 入库总数,Sum(A.产品重量) AS 产品总重,
Sum(A.油肺掌翅) AS 油肺掌翅,(Sum(A.产品重量) + Sum(A.油肺掌翅))/采购总重 AS 入库成数 FROM 车次明细数据B as X,(SELECT B.成品入库单编号,Sum(iif((B.中类='52' or B.中类='53'),B.数量,0)) AS 产品数量, _
Sum(iif((B.中类= '52' or B.中类= '53' or B.产品编号='3423019' or B.产品编号='3423030' or B.产品编号='3423040' or B.产品编号='3423042'),B.重量,0)) AS 产品重量, _
Sum(iif((B.产品编号='3423007' or B.产品编号='3423011' or B.产品编号='3423012' or B.产品编号='3423006' or B.产品编号='3433012' or B.产品编号='3433013' or B.产品编号='3433018' or B.产品编号='3433006'),B.重量,0)) AS 油肺掌翅 FROM 入库明细表 AS B _
WHERE B.作废='N' GROUP BY B.成品入库单编号) AS A WHERE ((A.成品入库单编号=X.成品入库单编号) AND (X.日期= # " & Da & "#)) GROUP BY X.种类,X.供应商,X.采购交接表单号,X.日期,X.车顺序 ORDER BY X.日期 DESC,X.车顺序"
初学,语句写的很乱,请多指教! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询