|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 ly 于 2011-12-18 21:05 编辑
- TRANSFORM Sum(汇总.对应号) AS 对应号之合计
- SELECT 汇总.编单号
- FROM (SELECT 表4.对应号, [3].d AS dd, [3].日期1, [3].编单号
- FROM 表4, (SELECT [1].日期1, [1].编单号, [2.数量之合计]/[1.数量之合计] AS d
- FROM (SELECT Format([日期],"mm""月份""") AS 日期1, 表2.编单号, Sum(表2.数量) AS 数量之合计
- FROM 表2 GROUP BY Format([日期],"mm""月份"""), 表2.编单号) as 2 INNER JOIN
- (SELECT Format([日期],"mm""月份""") AS 日期1, 表1.编单号, Sum(表1.数量) AS 数量之合计
- FROM 表1 GROUP BY Format([日期],"mm""月份"""), 表1.编单号) as 1
- ON ([2].日期1 = [1].日期1) AND ([2].编单号 = [1].编单号)) as 3
- WHERE ((([3].d)>[起号] And ([3].d)<=[止号]))) AS 汇总
- GROUP BY 汇总.编单号
- PIVOT 汇总.日期1;
复制代码 就楼主提供的样本数据尝试一下。可能会有错误,见谅。
db1 - 副本.rar
(27.12 KB, 下载次数: 20)
|
|