MS Access Like statement with multiple values

Hi All,

I am writing an access application for our company and have come across a problem thats been bugging me.

i need to do a like statement for 2 values in the same field

example i need to select products with the prefix 01 and 21

i tried this

SELECT ItemNumber FROM tblProducts WHERE ItemNumber Like '01*' AND ItemNumber Like 21

but it didnt work when i do a like with just 01 or just 21 it works fine, is there a way i can filter it by just these two?
LVL 1
paul612Asked:
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.

Patrick MatthewsCommented:
SELECT ItemNumber FROM tblProducts WHERE ItemNumber Like "01*" OR ItemNumber Like "21*"

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
tigin44Commented:
SELECT ItemNumber FROM tblProducts WHERE ItemNumber Like '01*' OR ItemNumber Like '21*'

will brougt you alll the items with the prefixex 01 and 21.
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
SELECT ItemNumber FROM tblProducts WHERE ItemNumber IN (01,21)

mx
paul612Author Commented:
I split the points as you both said the same thing at the exact same posting time, i didnt even think to try OR my brain isnt working today at all
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.