I have an access 360 data base of about 10000 orders. Each record (order) shows the type number ordered, the quantity and total price. Only one type number per order. How can I make a query which shows the total revenue and quantity by type number?
Microsoft Access
Last Comment
PatHartman
8/22/2022 - Mon
Shaun Kline
Is revenue something other than Quantity * Price?
If you want to run this across all orders, you would use the above calculation and group by Type Number, excluding all other columns.
Brian Sowter
ASKER
Could you please get me started with groups. I already have revenue as a field. I have generated a table of type numbers
Gustav Brock
That could be a query like:
Select [type number], Sum([quantity]), Sum([revenue])From YourTableGroup By [type number]
That's up to you.
Open a new query, go to SQL view, paste the code, and edit it to match you table and field names.
Then you can switch to the design view to study.
Brian Sowter
ASKER
This is my code:
SELECT SUM([Qty]) FROM Query1 GROUP BY [Type]
SELECT [Type], SUM([Qty]) FROM Query1 GROUP BY[Type]
SELECT [Type], SUM([Value] FROM Query1 GROUP BY [Type]
I get "Syntax error in query expression '[Type] SELECT [Type]" after saving
Gustav Brock
You can only have one Select in a normal query.
See my query above.
If you want to run this across all orders, you would use the above calculation and group by Type Number, excluding all other columns.