Query Syntax for Finding Field Values Containing NON-AlphaNumeric Characters

Hello ~

Could someone suggest a way to query a field for all field values containing non-alpha-numeric characters.  I've written the following to find all instances of "#", but I also need to find all other characters INCLUDING punctuation:

Best Regards, Jacob
SELECT Stock_Info.Stock_Num
FROM Stock_Info
WHERE (((InStr(1,[Stock_Num],"#"))>0));

Open in new window

LVL 2
Chi Is CurrentAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kerwinsiyCommented:
select ISNUMERIC('12K')
SELECT Stock_Info.Stock_Num
FROM Stock_Info
WHERE 
 isnumeric([Stock_Num]) = 0

Open in new window

0
kerwinsiyCommented:
try this.
SELECT Stock_Info.Stock_Num
FROM Stock_Info
WHERE 
 isnumeric([Stock_Num]) = 0

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Chi Is CurrentAuthor Commented:
kerwinsiy ~  Thank you for your reply.

I would also like to include hyphens as acceptable characters.  In other words,

show: all field values containing non-alphanumeric characters, EXCLUDING hyphens.

I have also found the following LIKE statement also works but also displays values containing hyphens (of course):

SELECT Stock_Info.Stock_Num
FROM Stock_Info
WHERE (((Stock_Info.Stock_Num) Like "*[!0-9A-Z]*"));

Open in new window

0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

kerwinsiyCommented:
just replace the hypen to blank in order to exlude it. hope it help

SELECT Stock_Info.Stock_Num
FROM Stock_Info
WHERE
 isnumeric(REPLACE([Stock_Num],'-','')) = 0

0
Chi Is CurrentAuthor Commented:
Values containing hyphens also appear in the result w/ statement above.

J
0
kerwinsiyCommented:
ill provide some values
tag it if it should be counted. thanks


1) a
2) a2
3) 34
4) 43-23

0
Chi Is CurrentAuthor Commented:
Searching the web also, I ran across the following with an excellent discussion on: LIKE

http://bytes.com/forum/thread448043.html

I'm using:

SELECT Stock_Info.Stock_Num
FROM Stock_Info
WHERE (((Stock_Info.Stock_Num) Like "*[!-!0-9A-Z]*"));


Which works perfectly.  I can also include / exclude other characters easily.

Thank you for your assistance here.

Best Regards, Jacob
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.