原帖由 ghw87654321 于 2009-7-30 23:49 发表
select "期初",类别,编号,名称,单位,日期,票号,数量,0 as 数量3, 0 as 数量2, 金额,0 as 金额3, 0 as 金额2 from [期初结余$] union all select "入库",类别,编号,名称,单位,日期,票号, 0 as 数量2, 数量,0 as ...
select 类别,编号,名称,数量 as 期初数量,金额 as 期初金额,0 as 入库数量,0 as 入库金额,0 as 出库数量,0 as 出库金额,日期 from [期初结余$] where 数量>0 union all
select 类别,编号,名称, 0 as 期初数量,0 as 期初金额, 数量 as 入库数量,金额 as 入库金额,0 as 出库数量,0 as 出库金额,日期 from [本期入库$] where 数量>0 union all
select 类别,编号,名称,0 as 期初数量,0 as 期初金额, 0 as 入库数量,0 as 入库金额,数量 as 出库数量,金额 as 出库金额,日期 from [本期出库$] where 数量>0 |