SELECT 商品基础资料表.款号计算, 商品基础资料表.物资所属大类名称代码, 商品基础资料表.物资所属大类名称, A.期初, B.进货, C.出货, Nz([期初],0)+Nz([进货],0)-Nz([出货],0) AS 库存
FROM (([SELECT 期初数据.款号计算, Sum(期初数据.期初数量) AS 期初
FROM 期初数据
GROUP BY 期初数据.款号计算]. AS A RIGHT JOIN 商品基础资料表 ON A.款号计算 = 商品基础资料表.款号计算) LEFT JOIN [SELECT 进货数据.款号计算, Sum(进货数据.进货数量) AS 进货
FROM 进货数据
GROUP BY 进货数据.款号计算]. AS B ON 商品基础资料表.款号计算 = B.款号计算) LEFT JOIN [SELECT 出货数据.款号计算, Sum(出货数据.出货数量) AS 出货
FROM 出货数据
GROUP BY 出货数据.款号计算]. AS C ON 商品基础资料表.款号计算 = C.款号计算;
原帖由 Henry D. Sy 于 2008-12-1 09:07 发表
SELECT 商品基础资料表.款号计算, 商品基础资料表.物资所属大类名称代码, 商品基础资料表.物资所属大类名称, A.期初, B.进货, C.出货, Nz([期初],0)+Nz([进货],0)-Nz([出货],0) AS 库存
FROM (([SELECT 期初数据.款 ...