Last post Feb 16, 2015 08:19 AM by Michelle Ge - MSFT
Feb 13, 2015 04:52 AM|yogeshweb|LINK
i want to get all the records which are more than 10 digit after removing the space from left.
i am using ltrim function but its not able to remove the space from left.
See my query
select INCARICO_ID, AccountNumber,LEN( LTRIM( RTRIM(AccountNumber))) as [Length]
where LEN( LTRIM( RTRIM(AccountNumber))) > 10
Feb 13, 2015 06:48 AM|gimimex|LINK
I believe they are not white spaces, because the LTrim function removes the white spaces:
declare @AccountNumber varchar(40);
set @AccountNumber = ' 123456789 ';
Hope this helps.
Feb 13, 2015 08:57 AM|limno|LINK
You may have special characters in your column. Please check this:
Feb 16, 2015 08:19 AM|Michelle Ge - MSFT|LINK
As @gimimex suggestion, you can try to use RTrim() and LTrim() function to remove the white space of a string.
There is a document about it, please refer to the link below:
Hope it's useful for you.