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!

Find Character in Text STring

Status
Not open for further replies.

dtay1132

IS-IT--Management
Nov 5, 2002
33
0
0
US
I have a database to which I import names and other information about businesses and then export the data as delimited txt files. Users are very bad about putting restricted characters in the name field for businesses. One of the services that I export to is very fussy about only certain characters being in the name field (specifically they allow only:
A-Z
a-z
0-9
&
- (hyphen)
space

I'm trying to figure out a way I could use a query to identify any record that had something other than these characters in the name field.
 
Pattern matches are not my strong suit, but you should try something like...

Select * From Table Where Field Not Like '%[^A-Za-z0-9 &-]%'

I'm fairly certain this would work in SQL Server, and I think it may work in Access as well.

You may need to change the % to *

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
thanks for the suggestion, I'll see if I can make it work.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top