You'll need a subquery in that spot. I'm not familiar with Over() - since there are no parameters, I assume that's going to give you the total from the whole query. So, include the same query again with an alias, and alias the first query just to reduce the typing, and you get something like this -
Code:
SELECT
Q1.[Part Number],
Q1.[Customer Name],
Q1.[Customer Number],
Q1.[SumOfQuantity],
Q1.[TotalCost],
Q1.[TotalPrice],
Q1.[Gross Margin],
Q1.[TotalPrice] / Q2.SumTotalPrice AS WeightFactor
FROM [2-C: Avg Prices by Customer Number Query] AS Q1,
(SELECT SUM(Q2.[TotalPrice]) As SumTotalPrice
FROM [2-C: Avg Prices by Customer Number Query] AS Q2);
If Over() was doing some secret handling of grouping, like only giving you the Sum for each [Customer Number], then you'd have to include all the grouping fields into the Q2 subquery and specify the JOIN criteria.
That would look somewhat like this one, but it's total aircode....
Code:
SELECT
Q1.[Part Number],
Q1.[Customer Name],
Q1.[Customer Number],
Q1.[SumOfQuantity],
Q1.[TotalCost],
Q1.[TotalPrice],
Q1.[Gross Margin],
Q1.[TotalPrice] / Q2.SumTotalPrice AS WeightFactor
FROM [2-C: Avg Prices by Customer Number Query] AS Q1
INNER JOIN
(SELECT Q2.[Customer Number], SUM(Q2.[TotalPrice]) As SumTotalPrice
FROM [2-C: Avg Prices by Customer Number Query] AS Q2
GROUP BY Q2.[Customer Number])
ON Q2.[Customer Number] = Q1.[Customer Number]
);
This thread had some correlated subquery SQL that was more solid: https://www.accessforums.net/access/...ess-35607.html