Dear Experts,
How to retrieve the "Remaining Amount" from "Vendor Ledger Entry" table with help of SQL server. It is a flowfield.
I am trying to retrieve it help of [XYZ Private Limited$Detailed Vendor Ledg_ Entry] table but always comes the wrong value.
Please help me to short this. My sql query is below.
select sum(DVLE.Amount) "Remaining Amount",VLE.[Document No_],VLE.[Document Date],VLE.[Currency Code],VLE.[Vendor No_],[XYZ Private Limited$Vendor].Name "Vendor Name"
from [XYZ Private Limited$Vendor Ledger Entry] VLE
left outer join [XYZ Private Limited$Detailed Vendor Ledg_ Entry] DVLE on DVLE.[Document No_] = VLE.[Document No_]
and DVLE.[Vendor No_] = VLE.[Vendor No_] and DVLE.[Vendor Ledger Entry No_] = VLE.[Entry No_] and DVLE.[Posting Date] = VLE.[Posting Date]
left outer join [XYZ Private Limited$Vendor] on [XYZ Private Limited$Vendor].No_ = VLE.[Vendor No_]
where VLE.[Document Type] = 2 and DVLE.[Document Type]=2 and DVLE.Amount >0
and VLE.[Vendor No_] = 'V-DO-0451' and VLE.[Document No_] ='GV-101-16-11-111'
group by VLE.[Document No_],VLE.[Document Date],VLE.[Currency Code],VLE.[Vendor No_],[XYZ Private Limited$Vendor].Name
*This post is locked for comments
I have the same question (0)