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
 General SQL Server Forums
 New to SQL Server Programming
 use of Replace option

Author  Topic 

javahf
Starting Member

34 Posts

Posted - 2011-04-07 : 00:44:03
In the inquiry below

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 into Options field
and replace any string of &lg or &gf with ''

raghuveer125
Constraint Violating Yak Guru

285 Posts

Posted - 2011-04-07 : 00:57:23
Send some records how you want?

Raghu' S
Go to Top of Page

javahf
Starting Member

34 Posts

Posted - 2011-04-07 : 01:03:02
quote:
Originally posted by raghuveer125

Send some records how you want?

Raghu' S



Data looks like this now
[</I>Handlebars:Riser + Oury Grips][</I>Size:55][Add Tire Set:No Extra Tire Set][Pedal Type:Standard,
want it to look like
[Handlebars:Riser + Oury Grips][Size:55][Add Tire Set:No Extra Tire Set][Pedal Type:Standard,
need to get rid of < and /I>
in the report
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-04-07 : 02:20:25
javahf, please continue on the original thread and don't create new thread.

Original Thread : http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=159154
Spawn Thread : http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=159158


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

Go to Top of Page
   

- Advertisement -