|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
select 日期,品名,仓库,出入库,int(数量/12) as 久保件数,数量-int(数量/12)*12 as 久保数量,0 as 苹果件数,0 as 苹果数量 from [sheet1$] where [sheet1$].品名="1680久保" and [sheet1$].单位="瓶" union all
select 日期,品名,仓库,出入库,数量 as 久保件数,0 as 久保数量,0 as 苹果件数,0 as 苹果数量 from [sheet1$] where [sheet1$].品名="1680久保" and [sheet1$].单位="件" union all
select 日期,品名,仓库,出入库,0 as 久保件数,0 as 久保数量,int(数量/24) as 苹果件数,数量-int(数量/24)*24 as 苹果数量 from [sheet1$] where [sheet1$].品名="360苹果" and [sheet1$].单位="瓶" union all
select 日期,品名,仓库,出入库,0 as 久保件数,0 as 久保数量,数量 as 苹果件数,0 as 苹果数量 from [sheet1$] where [sheet1$].品名="360苹果" and [sheet1$].单位="件"
再建一个sheet4
select 日期,品名,仓库,出入库,久保件数+苹果件数 as 件数,久保数量+苹果数量 as 数量 from [Sheet3$]
先去吃饭,吃完饭再来
[ 本帖最后由 kumoo 于 2009-8-3 13:01 编辑 ] |
|