View Single Post
Old 03-03-2006, 10:54 AM   #5
ZK
Zilvia FREAK!
 
ZK's Avatar
 
Join Date: May 2003
Location: North Cal
Posts: 1,088
Trader Rating: (0)
ZK is making a name for him/her selfZK is making a name for him/her selfZK is making a name for him/her self
Quote:
Originally Posted by jOeHaCk98
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!
Use this:

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.
ZK is offline   Reply With Quote