2014-02-26 65 views
0
UPDATE [PipeLine] SET [PipeLine].[Building Rating] = 'A-' 
WHERE ((([PipeLine].[NDA Status])<>'No' And ([PipeLine].[Building Status])<>'No') AND (([PipeLine].[Deal With Partner])<>'No') AND (([PipeLine].LAND)<>'No') AND (([PipeLine].Connect)<>'No')); 

UPDATE [PipeLine] SET [PipeLine].[Building Rating] = 'B' 
WHERE ((([PipeLine].[Building Status])<>'No' And ([PipeLine].[Building Status])<>'No') AND (([PipeLine].[Deal With Partner])<>'No')); 
+0

並運行該查詢之前,請注意,您有重複,可能鍵入錯誤的邏輯:'([管道] [大廈狀態])<>「不」,([管道] [大廈狀態] )<>「No''。 – mbroshi

+0

一切正常,只是如何把它們放在一起 –

回答

1
UPDATE [PipeLine] 
SET [PipeLine].[Building Rating] = 
    CASE 
    WHEN ((([PipeLine].[NDA Status])<>'No' And ([PipeLine].[Building Status])<>'No') AND (([PipeLine].[Deal With Partner])<>'No') AND (([PipeLine].LAND)<>'No') AND (([PipeLine].Connect)<>'No')) 
     THEN 'A-' 
    WHEN ((([PipeLine].[Building Status])<>'No' And ([PipeLine].[Building Status])<>'No') AND (([PipeLine].[Deal With Partner])<>'No')) 
     THEN 'B' 
    END; 
+0

語法錯誤,何時? –