select 库别,日期,品名,规格,计量单位,数量 as 期初数量,金额 as 期初金额,0 as 入库数量,0 as 入库金额,0 as 出库数量,0 as 出库金额 from [数据源$] where 类型=11 union all
select 库别,日期,品名,规格,计量单位,数量 as 期初数量,金额 as 期初金额,0 as 入库数量,0 as 入库金额,0 as 出库数量,0 as 出库金额 from [数据源$] where 类型=22 union all
select 库别,日期,品名,规格,计量单位,数量 as 期初数量,金额 as 期初金额,0 as 入库数量,0 as 入库金额,0 as 出库数量,0 as 出库金额 from [数据源$] where 类型=33
select 库别,日期,品名,规格,计量单位,数量 as 期初数量,金额 as 期初金额,0 as 入库数量,0 as 入库金额,0 as 出库数量,0 as 出库金额 from [数据源$] where 类型=11 union all
select 库别,日期,品名,规格,计量单位,0 as 期初数量,0 as 期初金额,数量 as 入库数量,金额 as 入库金额,0 as 出库数量,0 as 出库金额 from [数据源$] where 类型=22 union all
select 库别,日期,品名,规格,计量单位,0 as 期初数量,0 as 期初金额,0 as 入库数量,0 as 入库金额,数量 as 出库数量,金额 as 出库金额 from [数据源$] where 类型=33
注意观察语句的差异之处,下面的才是正确的语句。
[ 本帖最后由 penghaifeng 于 2009-10-4 16:05 编辑 ] |