如果我理解喲好了,所有你需要做的是創建表之間的連接,例如:
SELECT D.Field1, D.Field2, B.[Adjustment Value]
FROM Table_D AS D INNER JOIN Table_B AS B ON D.Link-To-B = B.Numerical_Key_B
欲瞭解更多信息,請參見:
Join tables and queries
How to: Perform Joins Using Access SQL
[編輯]
在表D,有一個領域,whi ch我在上面的snippit中標記爲「Link-to-C」。此字段應該與鏈接到一個加TableB.AdjustmentValue
SELECT D.Field1, D.Link-To-C + D.Link-To-A + B.[Adjustment Value] AS CalculatedField
FROM (Table_D AS D INNER JOIN Table_B AS B ON D.Link-To-B = B.Numerical_Key_B)
INNER JOIN Table_C AS C ON C.Numerical_Key_C = D.Link-To-C)
INNER JOIN Table_A AS A ON A.Numerical_Key_A = D.Link-To-A
注意的值來填充:我沒有機會來測試它。這只是一個想法。
最後,我需要警告您:訪問喜歡() /括號/多個連接時使用。
[EDIT2]根據討論
,下面的查詢將返回計算字段:
SELECT C.MetaLevel, R.LevelAdjustment, C.MetaLevel+ R.LevelAdjustment AS NominalLevel
FROM tblRank AS R INNER JOIN tblCreatures AS C ON R.ID = C.Rank;
如果你想在一個tblCreatures更新NominalLevel,使用這樣的查詢:
UPDATE tblCreatures AS C
INNER JOIN tblRank AS R ON R.ID = C.Rank
SET C.NominalLevel = (C.MetaLevel+ R.LevelAdjustment);
NominalLevel已更新。您可以選擇它也...
SELECT C.MetaLevel, R.LevelAdjustment, C.NominalLevel
FROM tblRank AS R INNER JOIN tblCreatures AS C ON R.ID = C.Rank;
乾杯,
馬切伊
如何查詢? –
我知道如何創建查詢,但我將如何使用查詢來填充字段?或者我誤解我應該如何構建這個? –
是的,你可以創建查詢返回計算數據甚至更好,你可以使用查詢結果來更新表字段。你想計算哪個領域?基於什麼條件? –