Manish Patat

Manish Patat

  • 1.7k
  • 68
  • 7.7k

SQl Query Through Plus Minus Stock Statement

Feb 6 2021 1:46 PM
 
I have Two Table 
1 table Po Table Field Like PONO,POLI,POQty
2 Table GRN Table Field Like GRNNO,PONO,POLI,GRNQty
3 table is My Output Table 
 
 My Query Like This
Select G.GRNNO,P.PONO,P.POLI,Isnull(P.QTY,0),isnull(G.InQty,0),Isnull(Isnull(P.QTY,0)-Sum(isnull(G.InQty,0)),0) As PendingQty from PO As P Left Outer Join GRN As G ON P.PONO=G.PONO And P.POLI=G.POLI Group By G.GRNNO,P.PONO,p.POLI,P.QTY,G.InQty 
 
But Output Not Exact To  OutPut Like This 
 
Thank in Advance 

Answers (1)