×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • 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!

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

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Wildcards in SQL

Wildcards in SQL

Wildcards in SQL

(OP)
I am trying to program a routine to check for certain elements within an email address. i.e. *@mailserver.com The problem is that I can't see a way to have sql check for wildcards. Actually at this moment I am using Access to program my database. I am using some sql in my programming. Is there a way to do this? Or do I need to migrate over to SQL Server to do it? Can it even be done?

RE: Wildcards in SQL

I don't know about Access, but in VFP you can imbed VFP functions in SQL - which isn't a good idea if you're planning to upsize to SQL server, and there is a performance hit. An example: SELECT * FROM names WHERE '@mailserver.com' $(lower(email)) The VFP $ operator means "is contained in".

RE: Wildcards in SQL

I don't mean to sound dumb, but what is VFP?

RE: Wildcards in SQL

I think what you're looking for is: Select * from names where mail like '%@mailserver.com' The % is a wildcard operator in SQL.

RE: Wildcards in SQL

Captaincaveman has the right of it. The original SQL standard specifies % (percent) as the multi-character wildcard symbol and _ (underscore) as the singl-character wildcard symbol. However, MS Access (and several other database systems) use the DOS wildcard symbols, * form multi-character and ? for single-character. I've even run across one odd-ball DBMS that allowed both!

RE: Wildcards in SQL

using the 'LIKE %String%'in the Where clause will return true if the 'String' exist in the row being examined, regardless of the position of the 'String' in the row.
For example:

Select * from myTable WHERE ColumnX LIKE %ABCD%

will return true if 'ABCD' was found in ColumnX.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

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! Already a Member? Login

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