Hi,
The following query returns this output
Select DATE,LOCN,Product,RETAIL, Sum(QTY) as TotalQty From MyFile
Group by DATE, LOCN, Product, RETAIL
Order By DATE, LOCN, Product, RETAIL DESC
Date LOCN Product Retail Total Qty
20030326 3702 1111 19.97 3
20030326 3702 2222 34.97 2
20030326 3702 3333 149.97 1
20030326 3703 4444 89.97 1
20030326 3703 1111 19.97 6
20030326 3703 1111 -19.97 1
The following query runs ok if there is no refund but if there is a refund as you see the last two lines, I want to convert these two lines
20030326 3703 1111 19.97 6
20030326 3703 1111 -19.97 1
to one line like that
20030326 3703 1111 19.97 5
Qty = 6 -1 = 5
How can I do this in the above SQL Statement
Thanks
The following query returns this output
Select DATE,LOCN,Product,RETAIL, Sum(QTY) as TotalQty From MyFile
Group by DATE, LOCN, Product, RETAIL
Order By DATE, LOCN, Product, RETAIL DESC
Date LOCN Product Retail Total Qty
20030326 3702 1111 19.97 3
20030326 3702 2222 34.97 2
20030326 3702 3333 149.97 1
20030326 3703 4444 89.97 1
20030326 3703 1111 19.97 6
20030326 3703 1111 -19.97 1
The following query runs ok if there is no refund but if there is a refund as you see the last two lines, I want to convert these two lines
20030326 3703 1111 19.97 6
20030326 3703 1111 -19.97 1
to one line like that
20030326 3703 1111 19.97 5
Qty = 6 -1 = 5
How can I do this in the above SQL Statement
Thanks