私は解決策を思いつきました.zane bienの答えは良いスタートでした. 主な問題は、複数の参加に対する ms アクセスの要件でした。基本的なブラケット構造は次のようになります。
Select a,b,c
FROM
(((Table1 Inner Join Table2 ON a = b)
Inner Join Table3 ON a = c)
Inner Join Table4 ON a = d)
そして、私の問題の解決策は次のとおりです。
SELECT A.loc AS Location, A.value AS Value,
(A.value - B.OneMonthAvg) / B.OneMonthStdev AS OneMonthZscore,
(A.value - C.ThreeMonthAvg) / C.ThreeMonthStdev AS ThreeMonthZscore,
(A.value - D.SixMonthAvg) / D.SixMonthStdev AS SixMonthZscore,
(A.value - E.OneYearAvg) / E.OneYearStdev AS OneYearZscore,
(A.value - F.TwoYearAvg) / F.TwoYearStdev AS TwoYearZscore,
(A.value - G.ThreeYearAvg) / G.ThreeYearStdev AS ThreeYearZscore
FROM
(((((((tbl AS A
INNER JOIN
(SELECT loc, AVG(value) AS OneMonthAvg, STDEV(value) AS OneMonthStdev
FROM tbl
WHERE date >= DateAdd('m', -1, Date())
GROUP BY loc)
AS B ON A.loc = B.loc)
INNER JOIN
(SELECT loc, AVG(value) AS ThreeMonthAvg, STDEV(value) AS ThreeMonthStdev
FROM tbl
WHERE date >= DateAdd('m', -3, Date())
GROUP BY loc)
AS C ON A.loc = C.loc)
INNER JOIN
(SELECT loc, AVG(value) AS SixMonthAvg, STDEV(value) AS SixMonthStdev
FROM tbl
WHERE date >= DateAdd('m', -6, Date())
GROUP BY loc)
AS D ON A.loc = D.loc)
INNER JOIN
(SELECT loc, AVG(value) AS OneYearAvg, STDEV(value) AS OneYearStdev
FROM tbl
WHERE date >= DateAdd('yyyy', -1, Date())
GROUP BY loc)
AS E ON A.loc = E.loc)
INNER JOIN
(SELECT loc, AVG(value) AS TwoYearAvg, STDEV(value) AS TwoYearStdev
FROM tbl
WHERE date >= DateAdd('yyyy', -2, Date())
GROUP BY loc)
AS F ON A.loc = F.loc)
INNER JOIN
(SELECT loc, AVG(value) AS ThreeYearAvg, STDEV(value) AS ThreeYearStdev
FROM tbl
WHERE date >= DateAdd('yyyy', -3, Date())
GROUP BY loc)
AS G ON A.loc = G.loc)
Where A.date = Date()
Z スコアを取得したい日付範囲を変更しました。