![]() |
|
Off Topic Chat All non related chat goes here. |
![]() |
|
Thread Tools | Display Modes |
|
![]() |
#1 |
Zilvia Addict
![]() |
School Help: DB Access question.
These are the fields:
Firstname, Lastname, Order Date, Product name, Quantity, Unit Price, OrderID Here is the problem I want to total up the customer orders, right now it is displaying each individual order. I want to delete the duplicate 'OrderID' BUT merge the 'Unit Price' THEN multiply by the 'Quantity' Can anyone help? THANKS! |
![]() |
![]() |
Sponsored Links |
![]() |
#3 |
Nissanaholic!
![]() Join Date: Dec 2001
Location: torrance, ca
Age: 41
Posts: 2,407
Trader Rating: (4)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Feedback Score: 4 reviews
|
i'd love to help, but i forgot all my SQL's...
although i can recommand a site to you, http://www.w3schools.com/ this thing helped me through college.
__________________
![]() |
![]() |
![]() |
![]() |
#5 | |
Zilvia FREAK!
![]() |
Quote:
Select distinct Firstname, Lastname, Order Date, sum(unit price*quantity) group by firstname, lastname, Order Date I feel old .. I graduated from college 6 years ago. |
|
![]() |
![]() |
![]() |
#7 | |
Zilvia FREAK!
![]() |
Quote:
You may think if you make more money you have more of it but in the end, it will get spent somewhere, somehow and all sorts of expenses you didn't predict will come out to fill it up so in the end you're about the same. As for SQL, I use it everyday so if you have any other questions let me know. |
|
![]() |
![]() |
![]() |
#9 |
Zilvia Addict
![]() |
in regards to the same question. My sql is:
SELECT Orders.OrderID, Customers.LastName, Orders.OrderDate, Products.ProductID, Products.ProductName, [Order Details].Quantity, Products.UnitPrice, [UnitPrice]*[Quantity] AS Amount FROM Products INNER JOIN ((Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID) INNER JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID) ON Products.ProductID = [Order Details].ProductID; My instructions are to: Create a query called Total Sales by Order, where you display total sales for each order id. |
![]() |
![]() |
![]() |
Bookmarks |
|
|