I have been thinking about how to do this query for hours but have yet to figure it out.
Here is what I have
Table
ItemCode Inv# ExtAmt
/ITM550 3221 500
/ITM550 3221 250
/ITM550 1111 100
/ITM550 1111 250
/ITM550 2222 800
/ITM100 1111 300
/ITM100 2000 400
Desired output
ItemCode Inv# ExtAmt ExtAmtTotals
/ITM550 3221 500 750
/ITM550 3221 250 750
/ITM550 1111 100 350
/ITM550 1111 250 350
/ITM550 2222 800 800
/ITM100 1111 300 300
/ITM100 2000 400 400
I am able to get the ExtAmtTotals and list the ItemCode and Inv# next to it but I can't get it to include the ExtAmt.
Here is the SQL that i have so far:
SELECT ItemCode, [inv#], SUM(ExtAmt) as ExtAmtTotals
FROM Table1
GROUP BY [inv#], ItemCode
ORDER BY ItemCode;
Here is what I have
Table
ItemCode Inv# ExtAmt
/ITM550 3221 500
/ITM550 3221 250
/ITM550 1111 100
/ITM550 1111 250
/ITM550 2222 800
/ITM100 1111 300
/ITM100 2000 400
Desired output
ItemCode Inv# ExtAmt ExtAmtTotals
/ITM550 3221 500 750
/ITM550 3221 250 750
/ITM550 1111 100 350
/ITM550 1111 250 350
/ITM550 2222 800 800
/ITM100 1111 300 300
/ITM100 2000 400 400
I am able to get the ExtAmtTotals and list the ItemCode and Inv# next to it but I can't get it to include the ExtAmt.
Here is the SQL that i have so far:
SELECT ItemCode, [inv#], SUM(ExtAmt) as ExtAmtTotals
FROM Table1
GROUP BY [inv#], ItemCode
ORDER BY ItemCode;