SELECT 日期, 收入合计 as 余额 from 1营业收入查询 union all
SELECT 日期, 扣款合计 as 余额 from 2营业扣费查询 union all
SELECT 日期, 金额之总计 as 余额 from 7其它收入查询 union all
SELECT 日期, -1*房费小计 as 余额 from 3房费支出查询 union all
SELECT 日期, -1*金额合计 as 余额 from 4管理费支出查询 union all
SELECT 日期, -1*金额合计 as 余额 from 5维修费支出查询 UNION ALL 建好查询后命名为联合查询
然后根据这个联合查询又建立一个合计查询,求得最终的合计效果
SELECT [联合查询].日期, Sum([联合查询].余额) AS 余额之总计
FROM [联合查询]
GROUP BY [联合查询].日期;
SELECT 日期, 收入合计 as 余额 from 1营业收入查询 union all
SELECT 日期, 扣款合计 as 余额 from 2营业扣费查询 union all
SELECT 日期, 金额之总计 as 余额 from 7其它收入查询 union all
SELECT 日期, -1*房费小计 as 余额 from 3房费支出查询 union all
SELECT 日期, -1*金额合计 as 余额 from 4管理费支出查询 union all
SELECT 日期, -1*金额合计 as 余额 from 5维修费支出查询 UNION ALL
select 日期, -1*费牌合计 as 余额 from 6技师费牌合计支出查询;
上面的联合查询漏了最后一句,select 日期, -1*费牌合计 as 余额 from 6技师费牌合计支出查询;