如何使用来自Tally的Sql查询按项目名称获取库存摘要

Below have XML code for Fetch Data from Tally.

<ENVELOPE>
   <HEADER>
      <TALLYREQUEST>ExportData</TALLYREQUEST>
   </HEADER>
   <BODY>
      <EXPORTDATA>
         <REQUESTDESC>
            <REPORTNAME>StockSummary</REPORTNAME>
            <STATICVARIABLES>
               <SVCURRENTCOMPANY>Company-2</SVCURRENTCOMPANY>
               <SVEXPORTFORMAT>$$SysName:HTML</SVEXPORTFORMAT>
                 <EXPLODEFLAG>YES</EXPLODEFLAG>
                <ISITEMWISE>YES</ISITEMWISE>
            </STATICVARIABLES>
         </REQUESTDESC>
      </EXPORTDATA>
   </BODY>
</ENVELOPE>
  1. How to write SQL QUERY in above code. for fetch data from tally.
  2. Using above code I fetch all StockSummary but I need only one item.
  3. Where do I write sql query in xml.

It is not possible to get the sql query via this XML snippet. You would need to go into the Tally code, search for this report([Report:StockSummary]), and then find the collection within this report. Once you know the collection, you will be able to pick out individual fields from the collection using the following query:

select $Field1, $Field2 from Collection_Name

Hope this helps.