SELECT [1 COL Query].Year, [1 COL Query].Month, [1 COL Query].Brand, IIf([1-1]>0,IIf([1-2]>0,(([1-1]-[1-2])/[1-1]),0),0) AS [2-1], IIf([1-1]>0,(DSum("[1-1]","[1 col query]","brand='" & [target query].[brand] & "'and year=" & [target query].[year] & " and month<=" & [target query].[month])-DSum("[1-2]","[1 col query]","brand='" & [target query].[brand] & "'and year=" & [target query].[year] & " and month<=" & [target query].[month]))/DSum([1-1],"[1 col query]","brand='" & [target query].[brand] & "'and year=" & [target query].[year] & " and month<=" & [target query].[month]),0) AS [2-1-1], [Target Query].[2-1-3]
FROM [1 COL Query] INNER JOIN [Target Query] ON ([1 COL Query].Brand = [Target Query].Brand) AND ([1 COL Query].Year = [Target Query].Year) AND ([1 COL Query].Month = [Target Query].Month)
ORDER BY [1 COL Query].Brand, [1 COL Query].Year, [1 COL Query].Month;