Hello,
Here's what I would like to accomplish but i'm not sure if is even possible.
Here's a the data;
Table1
SELECT table1.item, SUM(table1.ordqty - table1.shipqty)as total_result......
I would like to multiply the result of the above with the price field, in other words whatever the total of table1.ordqty - table1.shipqty is, multiply the result with the price field and put it in new column, this will give me a total of loss for that item. In the above table a customer order 25 items but only 23 shipped, therefore 2 were shorted (2*5.99=11.98 of loss in this sale. Can this be done in SQL? If so your help will be greatly appreciated.
Thanks in advanced.
Here's what I would like to accomplish but i'm not sure if is even possible.
Here's a the data;
Table1
SQL:
item ordqty shipqty price
1234 25 23 5.99
SELECT table1.item, SUM(table1.ordqty - table1.shipqty)as total_result......
I would like to multiply the result of the above with the price field, in other words whatever the total of table1.ordqty - table1.shipqty is, multiply the result with the price field and put it in new column, this will give me a total of loss for that item. In the above table a customer order 25 items but only 23 shipped, therefore 2 were shorted (2*5.99=11.98 of loss in this sale. Can this be done in SQL? If so your help will be greatly appreciated.
Thanks in advanced.