sqlserver2000的查询分析器里可用,在PB里却取不出数据,点改
SELECT #temp_comm.comm_code, #temp_comm.mo, isnull(ac_bill_detail.qty,0) * isnull(ac_cal_logic.cal_logic,0), 0, 0, 0
FROM #temp_comm, ac_bill, ac_bill_detail,ac_cal_logic
WHERE ac_bill.computer_no = ac_bill_detail.computer_no
and ac_bill_detail.comm_code = #temp_comm.comm_code
and (ac_bill.occur_date >= #temp_comm.stock_start and ac_bill.occur_date < #temp_comm.start_date)
and (ac_cal_logic.stock_type = 'CPC' or ac_cal_logic.stock_type = 'FCPC')
and ac_bill.bill_type_code = ac_cal_logic.bill_type_code
and ac_bill.audit_status = 1
and #temp_comm.comm_type = 0