Clearsky24
New member
- Local time
- Today, 10:48
- Joined
- Mar 12, 2003
- Messages
- 8
Yesterday I got help when I was building a query to show the last order by a customer. That way I could quickly see an email and phone number of customers who haven't used us in the last four months. I couldn't figure out how to show only the last order date.... but we figured it out by doing a total then max on the last order date.
But now I thought, since I got that to work I have more questions.... GREED
So I have my querry merging company info name phone email etc... with the last date they ordered from the orders table, which results in just 1 line for each customer.
Anyhoo, Now I am adding to that querry with a UnitPrice column, and what I want to see is.... the total of all of their orders, so if they ordered 15 logos at $50 a piece it would say $750 Instead when I do Sum of Unit price it tells me $11250 which is the Sum of all of their orders * the number of orders they received.
What in the heck am I doing wrong here?
But now I thought, since I got that to work I have more questions.... GREED
So I have my querry merging company info name phone email etc... with the last date they ordered from the orders table, which results in just 1 line for each customer.
Anyhoo, Now I am adding to that querry with a UnitPrice column, and what I want to see is.... the total of all of their orders, so if they ordered 15 logos at $50 a piece it would say $750 Instead when I do Sum of Unit price it tells me $11250 which is the Sum of all of their orders * the number of orders they received.
What in the heck am I doing wrong here?