Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...This site is a great forum to exchange knowledge..."

Geography

Where in the world do Tek-Tips members come from?
Doug (Staff)
26 Jun 98 18:47
I would like to be able to detect partial matches in a Database field. I know the LIKE command, but it doesn't seem to want to work here. What I'm trying to match has the wildcard character IN the database field, the reverse of the usual where %xxx% = FIELD. The fields are layed out similar to this h%dh%nt%r.
aahz (Programmer)
28 Jun 98 12:46
There are a couple of ways you might try. Remember that the '%' is used for multiple character wildcards. You can also use a single character search, I believe its the '?' but I would have to look it up. The search that you are using should work, but if your fields are long, then you will have problems. There is no wildcard that will do UP TO (say) 5 characters, but not more. If you want more than one character, you statement building it from scratch would grow exponentially, and I think it would cause you other problems. It does look like you are searching for key words, or full text indexing. Are either of these the case? There are some other ways of thinking about how to do things. If you want to give me some more info, I will try to help out. I hope this was useful.
Doug (Staff)
28 Jun 98 16:46
Here's my code: SELECT Handle.Mail, Restrict.Email from Handle, Restricted WHERE Handle.Mail LIKE Restrict.Email. My wildcard characters are in Restrict.Email. It gives me an error saying that I am improperly using the field (like it is in the wrong place). If I put Restrict.Email first, it doesn't return anything at all, even when I know it should give me a match.
PureNSimple (Programmer)
2 Oct 98 14:11
Salam (Hi)
There are two wild cards that are used in SQL, LIKE and Underscore '_' and you can use these as

Example 1
Select Field1 from mytable where Field1 LIKE '%mile'
Result: It will retrieve words that start with anything but that end with mile. e.g Smile, Shumile, frafrommile etc.
Example 2
Select Field1 from mytable where Field1 LIKE 'mi_e'
Result: It will return words that start with 'm' end with 'e' but can contain any character after 'i' e.g "mine", "mile", "mike" etc.
This '_' is called character wild card.

I hope it will help you. :)
Doug (Staff)
2 Oct 98 15:52
Thanks, actually that was exactly what I was looking for. I'll give it a try...:)

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close