用sql server做;
把这两个表导入sql server,
第一个表名t1, 字段:t_no, t_type, t_cust, t_count, t_weight, t_date, t_custid
其中t_type字段,1代表入库,2代表出库,3代表退库,4代表退客;
第二个表名t2, 字段:t_no, t_fpno, t_count, t_weight, t_date, t_custid
select t1.t_no, t1.t_count, t1.t_weight, t1.t_cust, t1.t_count, t1.t_weight, t2.t_fpno, t2.t_count, t2.t_weight
from t1
left join t2
...
可能要用子查询,有空再帮你搞吧;