all groups > sql server programming > may 2005 >
You're in the

sql server programming

group:

finding the letters



finding the letters rodchar
5/27/2005 7:37:23 PM
sql server programming: hey all,

if i have a field that contains values like these:
BOC123
MC123
FIN123

How do i just get the letters?

thanks,
Re: finding the letters Chris Hohmann
5/27/2005 8:39:02 PM
[quoted text, click to view]

DECLARE @s VARCHAR(8000)
SET @s='BOC123'
SELECT LEFT(@s,PATINDEX('%[0-9]%',@s)-1)

Re: finding the letters rodchar
5/28/2005 7:35:04 AM
Thank you very much that helped.

[quoted text, click to view]
AddThis Social Bookmark Button