|
我也遇到过此类问题,是这样做的,不知道对你有没有帮助。
先利入库资料和出库资料创建联合查询,是以产品来查,跟入库和出库单号无关的
SELECT 原料ID, 盘点重量 , 0 AS 实收重, 0 AS 退纱重, 0 AS 发纱净重, 0 AS 退纱净重 FROM 仓库盘点明细
union all select 原料ID, 0 AS 盘点重量, 实收重, 0 AS 退纱重, 0 AS 发纱净重, 0 AS 退纱净重 from 原料入库明细
UNION ALL select 原料ID, 0 AS 盘点重量, 0 AS 实收重, 退纱重, 0 AS 发纱净重, 0 AS 退纱净重 from 原料退库明细
UNION ALL select 原料ID, 0 AS 盘点重量, 0 AS 实收重, 0 AS 退纱重, 发纱净重, 0 AS 退纱净重 from 外发出库明细
UNION ALL select 原料ID, 0 AS 盘点重量, 0 AS 实收重, 0 AS 退纱重, 0 AS 发纱净重, 退纱净重 from 外发退库明细;
入发退查询
原料ID
盘点重量
实收重
退纱重
发纱净重
退纱净重
1
212
1
212
3
212
1
212
<FONT style="FONT-SIZE: |
|