JeepGeekin
asked on
Teradata IsNumeric
Does anyone know a way to filter out non-numeric characters in a char field?
I am looking for something like the following that works with Teradata:
Select * from table where IsNumeric(field1) = 1
I have a problem converting a string to an integer on a field that "should" contain all numbers, but it doesn't. Or if there's any way to not get a blasted "Bad Character in format or data" error whenever I try to convert the field to an integer.
I am looking for something like the following that works with Teradata:
Select * from table where IsNumeric(field1) = 1
I have a problem converting a string to an integer on a field that "should" contain all numbers, but it doesn't. Or if there's any way to not get a blasted "Bad Character in format or data" error whenever I try to convert the field to an integer.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Cool and thanks for posting your solution, be very useful for others in the same predicament
:)
Best of luck with the rest of your project
:)
Best of luck with the rest of your project
ASKER
OK. I feel stupid, so I'll post this as well. The Between statement can still recognize numeriic ranges when dealing with characters. This is probably the best way to handle this:
Select * from table where trim(field) BETWEEN '0' AND '99999'
(use as many 9's as you need)
Select * from table where trim(field) BETWEEN '0' AND '99999'
(use as many 9's as you need)
ASKER
Then I just filter thi smuch smaler list out. Also, I had to add a lower statement & a casespecific statement:
select * from Upper(field) <> Lower(Field) (CASESPECIFIC)
Thanks again!