@bluefeet said:
The problem is that you are using column aliases in the same Response column.
Actually, this is not a problem. MS Access does allow AS
clauses ("column aliases") to be used in the way OP used them.
Rather, the problem is that MS Access does not resolve AS
clauses in the ORDER BY
.
It modifies the ORDER BY
to use an ordinal position that corrects the query. Changes to the SELECT
- it's a red herring!
The following should work:
SELECT Market, Sum(Calls) AS SumOfCalls, Sum([A25-54 IMPs] * 1000) AS Impressions, Round(SumOfCalls/Impressions, 6) AS Response FROM DRTV_CentralOnly WHERE [Creative]<>'#N/A' GROUP BY Market ORDER BY 4 Desc;
source share