<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to use multiple Values in Universal Function SQL query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-multiple-values-in-universal-function-sql-query/m-p/12079415#M1970756</link>
    <description>&lt;P&gt;Hey Ian&lt;/P&gt;&lt;P&gt;Did you manage to figure this out? I have a similar requirement.&lt;/P&gt;&lt;P&gt;Pierre&lt;/P&gt;</description>
    <pubDate>Wed, 08 Dec 2021 14:43:21 GMT</pubDate>
    <dc:creator>pierrez</dc:creator>
    <dc:date>2021-12-08T14:43:21Z</dc:date>
    <item>
      <title>How to use multiple Values in Universal Function SQL query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-multiple-values-in-universal-function-sql-query/m-p/12079414#M1970755</link>
      <description>&lt;P&gt;Hi there this is my first post here please excuse any incorrect formatting or missing info&lt;/P&gt;
  &lt;P&gt;We have SAP Business One 9.3 (9.30.180) based on a SQL database. We have Boyum and Taskcentre installed&lt;/P&gt;
  &lt;P&gt;I have the case for user query where I would like to display a list of GL Codes to a user, which would be selected by a SQL statement, and then I would like to pass the multiple values selected by the user to SQL query&lt;/P&gt;
  &lt;P&gt;In pure SQL terms I am looking to replace the "IN" statement of the following statement with a variable. I can achieve this in SSRS&lt;/P&gt;
  &lt;P&gt;eg SQL statement&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;Declare @DateFrom DateTime = '2018-01-01 00:00:00'

Declare @DateTo DateTime = '2018-12-31 00:00:00'
SELECT 
T0.[DocNum], convert (varchar , T0.[DocDate],103)  PostingDate, convert (varchar, T0.DocDueDate ,3) PaymentDueDate,Case when T0.DocStatus='C' Then 'Closed' else T0.DocStatus end Status,T0.[CardCode],T0.[CardName],T0.NumAtCard SupplierInvNo,T0.[TransId],T1.[ItemCode],I.ItemName,isnull(T1.[Freetxt],'') AddText, T1.[Quantity], T1.[Price], T1.[LineTotal], T1.[AcctCode], GL.AcctName,isnull(T1.[OcrCode],'') CostCentre,isnull(T1.[OcrCode2],'') ProjectCode


FROM OPCH T0  with (nolock) INNER JOIN PCH1 T1  with (nolock)  ON T0.[DocEntry] = T1.[DocEntry] 

INNER JOIN OFPR T2  with (nolock)  ON T0.[FinncPriod] = T2.[AbsEntry]left outer join OITM I on T1.ItemCode=I.ItemCode

inner join OACT GL with (nolock) on T1.AcctCode=GL.AcctCode

WHERE T1.[AcctCode] in ('21000','23000','53000','53010','53020','53110','53120','53250','54080','54140','54160','54200','54210','54240','54450','54460','77300','77900')

and (T0.DocDate&amp;gt;=@DateFrom and T0.DocDate &amp;lt;=@DateTo)

ORDER BY T0.DocDate&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Jan 2020 17:18:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-multiple-values-in-universal-function-sql-query/m-p/12079414#M1970755</guid>
      <dc:creator>communitysap</dc:creator>
      <dc:date>2020-01-02T17:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to use multiple Values in Universal Function SQL query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-multiple-values-in-universal-function-sql-query/m-p/12079415#M1970756</link>
      <description>&lt;P&gt;Hey Ian&lt;/P&gt;&lt;P&gt;Did you manage to figure this out? I have a similar requirement.&lt;/P&gt;&lt;P&gt;Pierre&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 14:43:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-multiple-values-in-universal-function-sql-query/m-p/12079415#M1970756</guid>
      <dc:creator>pierrez</dc:creator>
      <dc:date>2021-12-08T14:43:21Z</dc:date>
    </item>
  </channel>
</rss>

