johnnyg123
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>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]*"
>>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]*"
where isnumeric([description])=-