Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Replace

Author  Topic 

javahf
Starting Member

34 Posts

Posted - 2011-04-07 : 02:08:45

SELECT o.Orderid,o.OrderStatus,o.BillingLastName,o.BillingCity,o.BillingState,o.PaymentAmount,o.TotalShippingCost, o.SalesTax1 ,
STUFF((SELECT ',' + ProductName FROM Orderdetails d WHERE o.Orderid = d.Orderid FOR XML PATH('')),1,1,'') as ProductName,
STUFF((SELECT ',' + CAST(d.Options AS VARCHAR(100)) FROM Orderdetails d WHERE o.Orderid = d.Orderid FOR XML PATH('')),1,1,'')
AS Options
FROM Orders o
where o.OrderID > 1179

How do I use Replace function to apply against the data extracted in the report into Options ( field)
and replace any string containing &lg or &gf which is in my data with '' so report looks better . I am not sure where to put the REPLACE function and syntax . That would make the report so much better for us .

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-04-07 : 02:23:49
original thread : http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=159154
duplicate thread
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=159157
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=159158


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -