SELECT Avg([T].[Income]) AS [Avg_Income], [T].[Income Class], [D1].[Postcode]
--, [D1].[Unique_ID] -- cannot use field due to GROUP BY
FROM [D2], [D1] -- order should be D2, D1, because D1 is then used in JOIN
ON [D1].[Unique_ID] = [T].[Unique_ID]
WHERE [D2].[Selection (I)]
AND DistanceEarth([D2].[ID],[D1].[ID],"km") <=15
Group by [D1].[Postcode],[T].[Income Class];
There are two changes from the original query:
1. [D1].[Unique_ID] is excluded from the SELECT list. You are using GROUP BY and groups might contain records with different values of that field - either specify which one of them you want using an aggregate, or group by it, or exclude it from the list (which is what I did).
2. The order of drawings in the FROM section cannot be D1, D2. The FROM section then reads as D1, (D2 JOIN T). The comma operator does translate into a join of its own, but it has a lower priority than an explicit JOIN. (D2 JOIN T) then fails because its join criteria tries to use fields from D1. Just swap D1 and D2 around to make the FROM section read D2, (D1 JOIN T). Or use parens: (D1, D2) JOIN T.
Hope this helps.