Comma delimited
Hi, I am using the following query in SSRS report Select c.Name, SUBSTRING( (SELECT ( ', ' + o.OrderId) FROM dbo.Orders o WHERE o.CustomerId = c.CustomerId FOR XML PATH('') ), 3, 1000) AS Col1 From Customers c When I am using the above query in SSRS report, the results are like below for the Col1: <Expr1>, 1234 </Expr1> <Expr1>, 1234, 321, 456 </Expr1> Here my requirement is I want to display all orders of a customer as comma delimited string, but when I execute the above Sql statement in Sqlserver management studio it is displaying fine like the below: 1234 1234, 321, 456. I am wondering why it is displaying as <expr1> in report. Thanks
March 7th, 2012 12:13pm

are you creating a report just to get a CSV output? with SSRS, you could build a report (a grid/table) and then have the user export it to CSV - and you won't have to worry about the CSV/Commas.
Free Windows Admin Tool Kit Click here and download it now
March 7th, 2012 12:50pm

No, In my report I've multiple columns. In one column I need to display all the orders of customer, if there are more than one need to display them as comma delimited string.
March 7th, 2012 1:00pm

Hi KJosh, Could you please provide more details about your report designing and results with some screenshot? Thanks, LolaPlease remember to mark the replies as answers if they help.
Free Windows Admin Tool Kit Click here and download it now
March 9th, 2012 3:54am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics