PB 报表提示“retrieve argument 1 does not match expected type” 类型不 一样
本帖最后由 mfkpie 于 2013-11-05 01:17:22 编辑
SELECT *
FROM (
SELECT *
FROM (
SELECT wo_receipt.trans_date 入库日期
,sum(wo_receipt_line.quantity) AS 生产入库数量
,parent_idn 大类
,主类
FROM wo_receipt
,wo_receipt_line
,part
,ps
WHERE wo_receipt.trans_no = wo_receipt_line.trans_no
AND part.part_id = wo_receipt_line.part_id
AND ps.product_code = part.product_code
AND wo_receipt.receipt_type = 'F'
GROUP BY 入库日期
,大类
,主类
) a
LEFT JOIN product_code ON product_code.product_code = a.大类
) b
LEFT JOIN product_code ON product_code.product_code = b.主类
WHERE b.入库日期 >= : 开始日期 and b.入库日期 <= : 结束日期
GROUP BY 大类
,大类名称
,主类
,主类名称
) rk
FULL JOIN (
SELECT*
FROM (
SELECT a.发货日期
,a.大类
,a.发货数量
,a.主类
,product_code.description 大类名称
FROM (
SELECT convert(CHAR(10), shipper.trans_date, 120) 发货日期
,parent_idN 大类
,sum(quantity) AS 发货数量
,主类
FROM ps
,shipper_line
,part
,shipper
WHERE part.part_id = shipper_line.part_id
AND ps.product_code = part.product_code
AND shipper.trans_no = shipper_line.trans_no
GROUP BY 大类
,发货日期
,主类
) a
LEFT JOIN product_code ON product_code.product_code = a.大类
) b
LEFT JOIN product_code ON product_code.product_code = b.主类
WHERE b.发货日期 >= : 开始日期 and b.发货日期 <= : 结束日期
GROUP BY 大类
,大类名称
,主类
,主类名称
) xs ON rk.大类 = xs.大类