我的查询具有外部联接并且以前在访问时工作正常,现在我将表链接到sql server并且它返回odbc失败,列不能绑定错误消息,如果我试图直接在sql server中运行查询它运行正常,如果我在访问中将其作为传递查询,它运行正常!
SELECT a.*, b.P_Date, a.Tag_id
FROM (
SELECT TP_Items.Tag_No, TP_Items.Tag_id, TP_Items.empty_wt, TP_Items.empty_wt*perc/100 AS perc_wt, TP_Prog_Act_Perc.Act_Descr, TP_Prog_Act_Perc.Perc, TP_Prog_Act_Perc.act_id
FROM TP_Items, TP_Prog_Act_Perc
WHERE TP_Items.Cont_ID=TP_Prog_Act_Perc.Cont_id
AND TP_Items.Proj_ID=TP_Prog_Act_Perc.Proj_id
) AS a
LEFT JOIN
tp_prog_tag AS b
ON (a.act_id=b.activity_id) AND (a.tag_id=b.tag_id)