|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
I'm trying to write an SQL statement that will pull out only numbers from a field. Within that field will be records that contain text, but i just want the records that have numbers in that field. Can I say something like
SELECT * FROM Table WHERE Variable = Numeric Is something like that possible? Thanks. |
|
#2
|
|||
|
|||
|
if all the fields in that record has numbers and charcters then, u cud return the string and then split the numeric value in the client side
hope this helps |
|
#3
|
|||
|
|||
|
This code works for me in sql 2k
select * from salesreps where isnumeric(storecode) > 0
|
|
#4
|
||||
|
||||
|
To find fields that contains numbers, you can also do this.
Code:
SELECT FieldName, PatIndex('%[0-9]%', FieldName)
FROM TableName
WHERE PatIndex('%[0-9]%', FieldName) > 0
|
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > SQL Numeric |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|