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 |
|
raviborra
Starting Member
14 Posts |
Posted - 2008-02-02 : 05:15:09
|
| Hi All,I am facing one problem here.Suppose the Emp_id is 'Emp01 ' in DataBase table for NT_ID='someid'But if i execute the following query, it is not trimming.declare @Emp_id VARCHAR(10);select @Emp_id = RTRIM(LTRIM(Emp_Id)) from Employee Where NT_ID ='someid'select @Emp_idThe answer is again 'Emp01 '.How to get the trimmed values in the select query iself.Thanks,Ravi. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-02 : 05:47:23
|
Beacuse the "space" is not a soft space (ascii 32). I think it is either hard space (ascii 160) or ascii 13 or ascii 10.Do a SELECT ascii(RIGHT(RTRIM(LTRIM(Emp_ID)), 1)) FROM Employee WHERE NT_ID = 'SomeID' E 12°55'05.25"N 56°04'39.16" |
 |
|
|
raviborra
Starting Member
14 Posts |
Posted - 2008-02-13 : 13:16:15
|
quote: Originally posted by Peso Beacuse the "space" is not a soft space (ascii 32). I think it is either hard space (ascii 160) or ascii 13 or ascii 10.Do a SELECT ascii(RIGHT(RTRIM(LTRIM(Emp_ID)), 1)) FROM Employee WHERE NT_ID = 'SomeID' E 12°55'05.25"N 56°04'39.16"
Hi,It was ASCII 9(Horizontal tab).Thanks. |
 |
|
|
|
|
|