Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determine the position of a char in a string 1

Status
Not open for further replies.

LonnieJohnson

Programmer
Apr 16, 2001
2,628
US
Is there anyway I can determine the position of a character in a set of characters in a column.

For example if MyField had the following data how could I determine what position the X was in using T_SQL?

123Xkk
iX4444
PpX2i7

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
charindex() function is wht you are looking for...

Known is handfull, Unknown is worldfull
 
from BOL:


CHARINDEX ( expression1 , expression2 [ , start_location ] )



Known is handfull, Unknown is worldfull
 
This is exactly what I was looking for. I searched the BOL for different string manipulation functions and did not see this.

You are the man!

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
welcome...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top