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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Select statement Substring

Status
Not open for further replies.

ChewDoggie

Programmer
Mar 14, 2005
604
US
Gmorning All,

I have a field in my sql db that contains data that might look like this:

System="Yes" testName="thisTestName" foran="twenty"

and I'm looking for a way to grab the string thisTestName from the field. Obviously, thisTestName is an example. The value could be any length of characters. I suspect I'll use SubString function but don't know how to determine where the first quote mark and the last quote mark appears after testName=.

Chew



10% of your life is what happens to you. 90% of your life is how you deal with it.
 
Have a look at the CHARINDEX function and use it to find testName, so that it can be used as the start point for another CHARINDEX to find the quotation marks.

soi là, soi carré
 
Thank you !

10% of your life is what happens to you. 90% of your life is how you deal with it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top