Hi all,
I have two querys
QueryPurchased
ProductID Location TotPcs
Prod1 Loc1 100
Prod2 Loc1 50
Prod3 Loc1 150
Prod3 Loc3 150
QuerySold
ProductID Location TotPcs
Prod1 Loc1 20
Prod2 Loc1 10
Prod3 Loc1 50
Prod3 Loc2 125
I want the result query to show as follows
QueryBalance
ProductID Location TotPcs
Prod1 Loc1 80
Prod2 Loc1 40
Prod3 Loc1 100
Prod3 Loc2 25
I can use a UNION ALL command to bring together
QueryPurchased query and QuerySold query but that will
just add the TotPcs instead of subtracting it.
I have a thought but don't know how to implement it.
If I can convert the TotPcs numbers of QuerySold query
from positive to negative and then do a UNION ALL then
I can achieve what I want to do or so I think.
Any suggestion or alternates will highly be
appreciated.
Thanking you all in advance