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!

Search function with Wild Card Characters

Status
Not open for further replies.

filp530

Programmer
Jun 20, 2003
6
0
0
US
Is there a function that could search a string of 10 characters using a wild character such as '*'.
For example: F*ND123456

would find FIND123456
FIND123456
FCND123456
FAND123456
FUND123456
FZND123456

Another example: F*ND******

FIND123456
FIND875364
FCND678765
FAND456454
FUND864125
FZND154845


Thanks for anyone who can help me


 

I'm assuming your retrieving from a table somewhere, but you can use an underscore in your SQL statement to act as a single character wildcard:

"SELECT * from myTable where ID like 'F_ND123456' "

will return FIND123456
FCND123456
FAND123456
FUND123456
FZND123456

"SELECT * from myTable where ID like 'F_ND%' "

will return FIND123456
FIND875364
FCND678765
FAND456454
FUND864125
FZND154845



Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Thank you MarkSweetland! That looks like it is going to work. I have been looking for this function for a while until I noticed this site.


Vance
 
Oh! I thought it could only be used as a prefix or suffix, and not in the middle of a string...

Sorry I don't have an alternative to offer at present


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top