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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 ignore characters in LEN or LENGTH Query

Author  Topic 

Fezi
Starting Member

3 Posts

Posted - 2015-03-26 : 09:25:25
I have data including '*' in one column in certain fields (Not in all rows) and I want to ascertain the Length without counting '*' .

Is this possible and if so what would be the simplest way to do this?

Fezi

mhorseman
Starting Member

44 Posts

Posted - 2015-03-26 : 09:38:22
How about:

select len(replace(yourcolumn,'*','') from yourtable

?

Mark
Go to Top of Page
   

- Advertisement -