I also want Date of A1.Ordno from table 2 where table 2 Ordno = A1.OrdNo
I don't understand what this means, where table 2 refers to the Test table in your query?
In addition, if you want to add the'S-' character in front of the field, you could try this:
select STUFF((Select Distinct + ',S-'+ A1.Ordno
from Test A1
where A1.No ={?No@}
FOR XML PATH('')),1,1,'') as SalesRef
If I misunderstood something, could you provide more details?
Best regards,
Xudong Peng
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
46 Points
180 Posts
Query
Sep 26, 2020 04:21 PM|jagjit saini|LINK
Hi
I have below query , I also want Date of A1.Ordno from table 2 where table 2 Ordno = A1.OrdNo
STUFF((Select Distinct + ', '+ A1.Ordno
from Test A1
where A1.No ={?No@}
FOR XML PATH('')),1,1,'') as SalesRef
Secondly i want to add S- to A1.Ordno
Thanks
Contributor
2110 Points
674 Posts
Re: Query
Sep 28, 2020 06:27 AM|XuDong Peng|LINK
Hi jagit saini,
I don't understand what this means, where table 2 refers to the Test table in your query?
In addition, if you want to add the'S-' character in front of the field, you could try this:
select STUFF((Select Distinct + ',S-'+ A1.Ordno from Test A1 where A1.No ={?No@} FOR XML PATH('')),1,1,'') as SalesRef
If I misunderstood something, could you provide more details?
Best regards,
Xudong Peng