2016-06-10 65 views
-1

下面的代碼工作在T-SQL罰款,但不是在JET SQL,在Access:更新與子查詢和地方

UPDATE Superliste_Temp 
SET [Plan-TGrp-Spanne_Stfl1] = 
(SELECT [Plan-TGrp-Spanne_Stfl1] 
FROM Superliste_Temp 
INNER JOIN dbo_Common_preferences 
    ON Superliste_Temp.Teil = dbo_Common_preferences.AktivesTeil) 
WHERE [Teilegruppe] = 
(SELECT [Teilegruppe] 
FROM Superliste_Temp 
INNER JOIN dbo_Common_preferences 
    ON Superliste_Temp.Teil = dbo_Common_preferences.AktivesTeil); 

爲什麼它不工作!?

回答

0

我有一個很難看的是SQL找出它試圖做的,但我知道,噴氣SQL需要SET語句中的聯接後,讓我最好的猜測是:

UPDATE Superliste_Temp, Superliste_Temp AS ST1 
    INNER JOIN dbo_Common_preferences AS pref1 
    ON ST1.Teil = pref1.AktivesTeil 
SET Superliste_Temp.[Plan-TGrp-Spanne_Stfl1] = [ST1]![Plan-TGrp-Spanne_Stfl1] 
WHERE (((Superliste_Temp.Teilegruppe)=[ST1]![Teilegruppe])); 
+0

早上好。有用。謝謝。 –