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!

How to fetch records which has "xxxx" middle value in a field

Status
Not open for further replies.

savi

Programmer
Oct 17, 2002
18
0
0
US
Hi guys,

I have a table with 3000 records and I have to fetch records only has particular value like "xxxx" in a character field.
That "xxxx" is anywhere in the place of that field value like "abcddxxxxtuelkj" , "abcxxxxeoeieo", "peiwodjxxxx" and so on.
for eg : table has fields, field1, field2, field3. I have to search in field3 whichever has inside string value "xxxx".
Please give me solution if you have any.
Thanks
 
Hi

You could try this:

select field1, field2, field3
from table
where field3 like '%xxxx%'

Hope that helps
John
 
Try this:

Select * from table
where CHARINDEX('xxxx', field3) > 0

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top