Quantcast
Channel: SQL Server Reporting Services
Viewing all articles
Browse latest Browse all 1418

Query execution failed for Dataset1 Incorrect Syntax Near ','

$
0
0

Hi

 I have below code , above error comes when i select multiple Tenders. If 1 is selected then works fine.

SELECT    distinct A.[Store No_], A.[Tender Code],

                           (SELECT      STUFF

                          ((SELECT     ',' + D.[Batch Number] AS [text()]

                              FROM         [Kamla Retail Limited$Store Batch Entry Line] D

                              WHERE     D.[Date] = A.[Date] AND D.[Store No_] = A.[Store No_]

                              and D.[Tender Code]=A.[Tender Code]

                              FOR XML PATH('')), 1, 1, ''))

AS [BO]

FROM         dbo.[ABS$Store Batch Entry Line] AS A

WHERE     (A.Date <= @date) AND (A.[Tender Code] In (@tender)) and A.[Store No_] in (@store)


Viewing all articles
Browse latest Browse all 1418

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>