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 |
|
a.ashabi
Posting Yak Master
117 Posts |
Posted - 2008-04-23 : 14:12:44
|
| Hi.I have a column wich has to be stripped.I wrote a query like this:UPDATE tbl_product3SET product_stripped = REPLACE(product_name, ' ', '-')it works fine.but the problem is if the space is at the beginning of the product_name I dont want to replace '-' at the beginning of the product_stripped.what sould I do to have the correct results." 170 caps" the result is "-170-caps" but I want "170-caps"(no - at the beginning)thanks |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-04-23 : 14:15:38
|
| UPDATE tbl_product3SET product_stripped = REPLACE(LTRIM(product_name), ' ', '-') |
 |
|
|
a.ashabi
Posting Yak Master
117 Posts |
Posted - 2008-04-23 : 14:19:42
|
| thanks |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-04-23 : 14:23:04
|
UPDATE tbl_product3SET product_stripped = REPLACE(ltrim(rtrim(product_name)), ' ', '-') E 12°55'05.25"N 56°04'39.16" |
 |
|
|
|
|
|