Group Together Prices In a Query?

R

Richard Horne

Hi Guys I have two tables, Orders and Order_Details which are queried in the
query below:

SELECT Orders.[Customer Name], Order_Details.OrderNumber,
Order_Details.Quantity, Order_Details.Price, Order_Details.ItemComplete,
[Quantity]*[Price] AS Total, Orders.Complete
FROM Order_Details INNER JOIN Orders ON Order_Details.OrderNumber =
Orders.OrderNumber
WHERE (((Orders.Complete)=No))
ORDER BY Orders.[Customer Name];


This query lists each customer with all their incomplete orders and the
quantity of goods ordered multiplied by the price of the item. Is there
anyway I can total up the TotalValue of orders for ecah customer?

So basically I'll want to see each customer's orders, the price and quantity
for each order, and then the total value of all their orders added up?
 
N

Nikos Yannacopoulos

Richard,

What you need is a report, not a query. Make a report on your existing
query, and use the grouping to get the customer totals; the report
wizard willl even take care of the totals for you.

HTH,
Nikos
 
R

Richard Horne

Hello again Nikos, are you my guardian angel this week?

So that's why I couldn't get it working, I should be using a report.

One thing though, I'm not sure how to get my report to take care of the
totals, there doesn't seem to be an option to do this when running the wizard.


Nikos Yannacopoulos said:
Richard,

What you need is a report, not a query. Make a report on your existing
query, and use the grouping to get the customer totals; the report
wizard willl even take care of the totals for you.

HTH,
Nikos

Richard said:
Hi Guys I have two tables, Orders and Order_Details which are queried in the
query below:

SELECT Orders.[Customer Name], Order_Details.OrderNumber,
Order_Details.Quantity, Order_Details.Price, Order_Details.ItemComplete,
[Quantity]*[Price] AS Total, Orders.Complete
FROM Order_Details INNER JOIN Orders ON Order_Details.OrderNumber =
Orders.OrderNumber
WHERE (((Orders.Complete)=No))
ORDER BY Orders.[Customer Name];


This query lists each customer with all their incomplete orders and the
quantity of goods ordered multiplied by the price of the item. Is there
anyway I can total up the TotalValue of orders for ecah customer?

So basically I'll want to see each customer's orders, the price and quantity
for each order, and then the total value of all their orders added up?
 
R

Richard Horne

YEy I've got it working.

Just had a mental block that's all.

Thanks Nikos.

Nikos Yannacopoulos said:
Richard,

What you need is a report, not a query. Make a report on your existing
query, and use the grouping to get the customer totals; the report
wizard willl even take care of the totals for you.

HTH,
Nikos

Richard said:
Hi Guys I have two tables, Orders and Order_Details which are queried in the
query below:

SELECT Orders.[Customer Name], Order_Details.OrderNumber,
Order_Details.Quantity, Order_Details.Price, Order_Details.ItemComplete,
[Quantity]*[Price] AS Total, Orders.Complete
FROM Order_Details INNER JOIN Orders ON Order_Details.OrderNumber =
Orders.OrderNumber
WHERE (((Orders.Complete)=No))
ORDER BY Orders.[Customer Name];


This query lists each customer with all their incomplete orders and the
quantity of goods ordered multiplied by the price of the item. Is there
anyway I can total up the TotalValue of orders for ecah customer?

So basically I'll want to see each customer's orders, the price and quantity
for each order, and then the total value of all their orders added up?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top