I have two tables in SQL Server GRV
and GIV
with these columns:
- GRV : Date, ProductID, ProductName, Unit, ReceivedQTY
- GIV : Date, ProductID, ProductName, Unit, Quantity
Query is as follows:
select
GRV.ProductID, GRV.ProductName, GRV.Unit, GRV.ReceivedQTY,
GIV.ProductID, GIV.ProductName, GIV.Unit, GIV.Quantity
from
GRV
full outer join
GIV on GRV.ProductID = GIV.ProductID
This is what I am getting:
The problem is the rows of red font are not actually in my GIV
table. What I want is only actual data of table should combine as it is. GRV
on right side and GIV
on left side without even rows indicating null
.
Is there any option available? The reason I need this to create a stock ledger Crystal Report where I can show all transactions of received and issue quantity date wise and generate closing balance in the end. Please help me in this regard.