多部分标识符无法在更新查询中绑定

时间:2013-07-30 20:29:26

标签: sql ms-access sql-update identifier

首先,我看了类似的问题,但没有找到我的案例。 我转入sql的访问代码如下(我没写过)

UPDATE QUpdateTrialstepApproved1 
INNER JOIN TrialStepApproved ON 
QUpdateTrialstepApproved1.cid_req = TrialStepApproved.cID 
SET TrialStepApproved.wm21 = [wm2_req], 
TrialStepApproved.sw = [startweek_req], 
TrialStepApproved.PlannedTotalm2 = [m2_req], 
TrialStepApproved.ew = [endweek_req], 
TrialStepApproved.ActualNrofDiffEntries = [entries_req],
TrialStepApproved.entryfactorTrial1 = [eFtrial_req],
TrialStepApproved.fixeddeliveryweek = [fixedEndweek_req],
TrialStepApproved.culturename = [culturename_req] 
WHERE (((QUpdateTrialstepApproved1.approveRequestChange)="v") 
AND ((TrialStepApproved.Location) Is Not Null));

我把它变成了以下但我在标题中得到了错误:

UPDATE A  
SET B.wm21 = [wm2_req], 
B.sw = [startweek_req], 
B.PlannedTotalm2 = [m2_req], 
B.ew = [endweek_req], 
B.ActualNrofDiffEntries = [entries_req], 
B.entryfactorTrial1 = [eFtrial_req], 
B.fixeddeliveryweek = [fixedEndweek_req], 
B.culturename = [culturename_req]
from QUpdateTrialstepApproved1 as A 
INNER JOIN TrialStepApproved as B ON A.cid_req = B.cID 
WHERE A.approveRequestChange='v' AND B.Location Is Not Null

1 个答案:

答案 0 :(得分:2)

您正在更新B,而不是A。将第一行更改为

UPDATE B

......事情会好起来的。

An SQLfiddle