Link to home
Start Free TrialLog in
Avatar of johnnyg123
johnnyg123Flag for United States of America

asked on

Access Query to return only numeric values

I realize this is a bit of a strange request but....

I have a table that has a text field that contains values that are either text or numbers

For example

ID  Description
1      2
2      Shop
3      Manager
4      5

I need to a query that would retrieve only rows that have a description value field that contains a number.

In the example above,

ID  Description
1      2
4      5
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
select ID, Description from tablex
where isnumeric([description])=-1
>>I need to a query that would retrieve only rows that have a description value field that contains
>>a number.

My code above tests whether the whole entry is numeric.  Now, if by "contains a number" you really mean "contains a digit character", that is a different story:

SELECT ID, Description
FROM SomeTable
WHERE Description Like "*[0-9]*"