psulions83
Board Regular
- Joined
- Nov 16, 2015
- Messages
- 127
Hi,
I have the below query in Access and it seems I am getting a line for each line in the tables. I only want a sum for the entire table which in return would give me one line back. Can anyone help? I have tried different variations in the group by section.
I have the below query in Access and it seems I am getting a line for each line in the tables. I only want a sum for the entire table which in return would give me one line back. Can anyone help? I have tried different variations in the group by section.
Code:
SELECT SUM(A.QUANTITY) AS QUANTITY,
(SUM(A.QUANTITY) / SUM(B.QUANTITY)) * B.AMOUNT AS AMOUNT,
"2_SALES" AS COMPONENT,
"ACCESS" AS SOURCE
FROM Tbl4 A,
Tbl7 B
WHERE A.PRODUCT = B.PRODUCT
GROUP BY A.PRODUCT=B.PRODUCT, A.QUANTITY, B.QUANTITY, B.AMOUNT
Last edited: