|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 6:36 AM
Points: 6,351,
Visits: 5,367
|
|
And this should correct the data....
UPDATE #tablename SET colname = STUFF(colname,1,1,'') WHERE colname LIKE '%WDT' AND colname <> 'WDT'
Far away is close at hand in the images of elsewhere. Anon.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Monday, April 29, 2013 12:19 AM
Points: 219,
Visits: 326
|
|
I have a space on the right side so changed the query accordingly . but afraid it shows no records.
SELECT DISTINCT [Code] = ASCII(right(LTRIM(valuecode), 1)), [Character] = '[' + right(LTRIM(valuecode), 1) + ']' FROM ListOfValues WHERE (valuecode LIKE '%WDT%') -- 32 ,[ ]
SELECT valuecode,CAST(valuecode as varbinary(4)) FROM ListOfValues WHERE valuecode LIKE 'WDT%' AND valuecode <> 'WDT' -- No Records
Sriram
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 6:36 AM
Points: 6,351,
Visits: 5,367
|
|
You need to do
LIKE '%WDT'
not
LIKE 'WDT%'
Far away is close at hand in the images of elsewhere. Anon.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Monday, April 29, 2013 12:19 AM
Points: 219,
Visits: 326
|
|
Yes David, I have done that rather tried both 1st time only, it returned no records.
Sriram
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 6:36 AM
Points: 6,351,
Visits: 5,367
|
|
OK. Maybe there are trailing non printable chars as well, should have thought of that .
Try
LIKE '%WDT%'
Far away is close at hand in the images of elsewhere. Anon.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Monday, April 29, 2013 12:19 AM
Points: 219,
Visits: 326
|
|
Thanks for you time friends. could not solve the issue, updated the col to varchar datatype.
Thanks again.
Sriram
|
|
|
|