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

Return part of a value in a field

Status
Not open for further replies.

texusgirl

Programmer
Aug 17, 2003
17
US
Hey everyone!
I am trying to dump some data and have a field called desc that has a vendor# at the end of the field within parens. I need to extract only that part of the field...any suggestions? Example desc = Test Data blah blah (V#1234); the only part of this field I need to dump is the (V#1234)
Thanks in advance,
texusgirl
 
SUBSTRING (DESC, CHARINDEX('(', DESC), LENGTH(DESC))

put this in your select statement and you should get what you're looking for.

HTH

Leslie

 
minor change - use this:

SUBSTRING (DESC, CHARINDEX('(', DESC) - 1, LENGTH(DESC))




Leslie
 
Worked like a charm! Thank you so much.[thumbsup2]
texusgirl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top