query to find numbers and not alphanumeric

access 2010:

I need a query that will only find me records that have a numeric pattern in then.

I need to find these:
Item
10000010
10000072
10000100
10000110
10000251
10000252
10000259
99999333
etc...



and not alphanumeric  combinations
Item
1CFJ4
1CFJ5
2ccc45
3wwe2

etc...

I was trying this but not working.

SELECT OneToOneMatches_2013.Item, OneToOneMatches_2013.del
FROM OneToOneMatches_2013
WHERE (((OneToOneMatches_2013.Item) Like '%[^a-zA-Z0-9]%'));

Thanks
fordraiders
LVL 3
FordraidersAsked:
Who is Participating?
 
Jeff DarlingDeveloper AnalystCommented:
here is a sample on how to do that.  Regex gets sent to a function.
ee-2015030201.accdb
0
 
Rey Obrero (Capricorn1)Commented:
try

SELECT OneToOneMatches_2013.Item, OneToOneMatches_2013.del
 FROM OneToOneMatches_2013
 WHERE IsNumeric(OneToOneMatches_2013.Item) = True
0
 
PatHartmanCommented:
you can use the IsNumeric() function.  Just be aware that decimal points are considered numeric for this purpose and d, e, and -, can make Access think the field is scientific notation which would be considered numeric.

The safest method is to write your own function that loops through each character and only if each individual character is numeric, is the whole field numeric.

I'm not sure what you are trying to do with the Where clause.  The * is the wildcard you probably want to use in Access.  You also only want the digits 0-9.  You don't want the others.
0
 
IrogSintaCommented:
If you numeric value always consists of 8 characters, you can use this instead for your WHERE clause:
WHERE (OneToOneMatches_2013.Item) Like "????????"

Ron
0
 
FordraidersAuthor Commented:
worked great..Thanks
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.