Hi,
I have data that looks like the following:
Inv Num Item Num Qty Location
H100 TT3456 5 L199
H100 OG5050 9 L123
H100 OG5050 6 L123
H100 TT3456 6 L199
H100 OG5050 5 L123
What I need to do is sum the Qty where the Location is the same.
This is my current SELECT statement:
SLELECT InvNum, ItemNum, Qty, Location
FROM InvoiceItems
WHERE Invoice = 'H100'
This will return all of the line items individually. I would like it to return this:
H100 OG5050 20 L123
H100 TT3456 11 L199
I assume that I would use the SUM function and maybe GROUP or DISTINCT, but I can't figure it out.
-Uncle Cake
I have data that looks like the following:
Inv Num Item Num Qty Location
H100 TT3456 5 L199
H100 OG5050 9 L123
H100 OG5050 6 L123
H100 TT3456 6 L199
H100 OG5050 5 L123
What I need to do is sum the Qty where the Location is the same.
This is my current SELECT statement:
SLELECT InvNum, ItemNum, Qty, Location
FROM InvoiceItems
WHERE Invoice = 'H100'
This will return all of the line items individually. I would like it to return this:
H100 OG5050 20 L123
H100 TT3456 11 L199
I assume that I would use the SUM function and maybe GROUP or DISTINCT, but I can't figure it out.
-Uncle Cake