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

RE: Returning a word from a field in a table 1

Status
Not open for further replies.

allyne

MIS
Feb 9, 2001
410
0
0
US
I have a sql table that contains a field as a varchar (2000). I need to pull a word from that field if it exists. For example:

Table/field name is note.text. If the note.text field contains the word 'Education' (this word can be anywhere with the text)then return the word 'Education'

Thanks for your help.

 
Code:
SELECT 'Education' AS SomeField
FROM TableName
WHERE CHARINDEX('Education', SomeField) > 0

NOT TESTED!!!

Borislav Borissov
VFP9 SP2, SQL Server
 
Or...

Code:
SELECT 'Education' AS SomeField
FROM TableName
WHERE NoteTextField LIKE '%Education%'


---- Andy

There is a great need for a sarcasm font.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top