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?
 
Patrick MatthewsCommented:
SELECT ItemNumber FROM tblProducts WHERE ItemNumber Like "01*" OR ItemNumber Like "21*"
0
 
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.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
SELECT ItemNumber FROM tblProducts WHERE ItemNumber IN (01,21)

mx
0
 
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.