Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppress field

Status
Not open for further replies.

heidi88

Programmer
May 1, 2003
32
0
0
US
I have dataset like this:

PO# Position Sequence# POQTY Invoice# InvoiceQTY

123 1 1 100 10 50
123 1 1 100 11 50

I need the result like this, so the PO QTY won't be doubled even the PO was invoiced twice with half of the original quantity on each invoice.

PO# Position Sequence# POQTY Invoice# InvoiceQTY

123 1 1 100 10 50
123 1 1 0 11 50

Does anyone know how? Thanks a lot.
 
SELECT PO#, Position, sequence#, sum(poQty) FROM myTable GROUP BY PO#, Position, sequence#

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top