all groups > sql server mseq > june 2004 >
You're in the

sql server mseq

group:

SQL Replace Function for Strings


SQL Replace Function for Strings Michael
6/6/2004 2:16:02 AM
sql server mseq:
Hi all
I have a colum with values likes this 2345:Text. The number behind the colon is always different. I want to remove the colon and the numbers behind the colon. Actually I would use the following statment: select *, replace (Colum1, '2345:','').
There seem to be no wildcards possible for the function REPLACE. Does anyone have a solution for this? I'm using Windows SQL 2000 Server.
Thanks
RE: SQL Replace Function for Strings Michael
6/6/2004 3:11:02 AM
H

I found the solution already
The solution is to find the position of the colon and than extract the string using this value from all values

For SQL: select KSName, SUBSTRING(KSName, PATINDEX('%:%',KSName)+1,1000) from jo

In Access:SELECT dbo_Job.KSName, Mid( dbo_Job.KSName, InStr(dbo_Job.KSName,':')+1 ,1000) AS Expr
AddThis Social Bookmark Button