|
SELECT DISTINCTROW 货品档案.货号, 货品档案.品名, 货品档案.规格,"" as 出货时间 ,left([入库单号],4) &"-"& mid([入库单号],5,2)&"-"& mid([入库单号],7,2) AS 入库时间,入库表.供应商, "" AS 领用部门, 入库表.入库单价, 入库表.入库数量, [入库数量]*[入库单价] AS 入库金额, 0 as 出库单价, 0 as 出库数量, 0 AS 出库金额
FROM (货品档案 inner JOIN 入库表 ON 货品档案.货号 = 入库表.货号)
UNION ALL SELECT DISTINCTROW 货品档案.货号, 货品档案.品名, 货品档案.规格,left([出库单号],4)&"-"& mid([出库单号],5,2)&"-"& mid([出库单号],7,2),"" AS 出库时间,"", 出库表.领用部门, 0 as 入库单价, 0 as 入库数量, 0 AS 入库金额, 出库表.出库单价, 出库表.出库数量, [出库数量]*[出库单价] AS 出库金额
FROM (货品档案 inner JOIN 出库表 ON 货品档案.货号 = 出库表.货号);
|
|