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.
| Author |
Topic |
|
javahf
Starting Member
34 Posts |
Posted - 2011-04-24 : 22:01:24
|
| I have the following inquiry which was written with help of few people on this site and works well . SELECT o.Orderid,o.OrderStatus,o.BillingLastName,o.BillingState,o.PaymentAmount,o.TotalShippingCost, o.SalesTax1 ,STUFF((SELECT ',' + d.Productname , d.options FROM Orderdetails d WHERE o.Orderid = d.Orderid FOR XML PATH('')),1,1,'') AS Productname FROM Orders o where o.OrderID > 1179output for field productname looks like : Marino<options>[</i>Handlebars:Riser + Oury Grips][</i>Size:55][Add Tire Set:No Extra Tire Set][Pedal Type:Standard Pedal Set][Add Hold Fast Straps:No Hold Fast Straps]</options>,$20 ILLITERATE PROMO [marino]<options></options>i would like :1-get rid of any word <option> , 2-Get rod of any </i> 3-where it says ADD and answer is NO - do not show that option 4- Field.options is a memo field and d.productname is text field ( perhaps that can help you to write a sperate line) The data should ideally look like Marino;[Handlebars:Riser + Oury Grips][Size:55][Pedal Type:Standard Pedal Set],$20 ILLITERATE PROMO [marino]I appreciate any help |
|
|
youky
Starting Member
5 Posts |
Posted - 2011-04-25 : 02:37:08
|
| unspammed |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|
|
|