Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching for a letter in a number string

Status
Not open for further replies.

bessebo

IS-IT--Management
Joined
Jan 19, 2001
Messages
766
Location
US
We occasionally have invalid serial numbers with letters contained within a numeric string. I want to be able to select out serial numbers that have a letter somewhere within the numeric string without having to do the following:

select * from inventory where serialnumber like '%A%' or serialnumber like '%B%'...

all the way through the alphabet. I think I've seen somewhere where you could put A..Z within the select statement somewhere. Is there an easy way to do what I want to do?

Regards,
Bessebo
 

You could try to use this:
select * from inventory where ISNUMERIC ( serialnumber ) = 0 -- This will return when it is a invalid numeric

and the following:

select * from inventory where ISNUMERIC ( serialnumber ) = 1 -- thei will return when it is a valid numeric

Let me know AL Almeida
NT/DB Admin
"May all those that come behind us, find us faithfull"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top