|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
合同号语句:
select 日期,销售合同单号 as 合同号,客户,金额¥,数量 as 玻璃个数,0 as 塑料个数 from [发出$a2:J19] where 产品类别="玻璃" union all
select 日期,销售合同单号,客户,金额¥,0,数量 from [发出$a2:J19] where 产品类别="塑料"
查询库存语句:
select 产品名称,[上月结余/只] as 上月结余,0 as 本月总收入,0 as 本月总发出,0 as 礼品收,0 as 礼品发 from [上月结余$] union all
select 产品名称,0,sum(数量),0,0,0 from [收入$a2:g10] group by 产品名称 union all
select 产品名称,0,0,0,sum(数量),0 from [收入$a2:g10] where 礼品 is not null group by 产品名称 union all
select 产品名称,0,0,sum(数量),0,0 from [发出$a2:j19] group by 产品名称 union all
select 产品名称,0,0,0,0,sum(数量) from [发出$a2:j19] where 礼品 is not null group by 产品名称 |
|