Click here to Skip to main content
14,739,758 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:
query to convert string field value(having numeric values) to integer/long in select statement itselef
Posted
Comments
Smithers-Jones 25-Oct-11 4:23am
   
Too lazy to phrase a full sentence. Lazy Bum (TM).

You could use CAST or CONVERT as:
CAST(MyVarcharCol AS INT)
 CONVERT(INT, MyVarcharCol)
   
v3
Comments
Amir Mahfoozi 29-Oct-11 7:33am
   
+5
member60 29-Oct-11 7:40am
   
THANK YOU AMIR
use cast function in sql statement like below

select cast(strValue as int)
   
Use the Cast or Convert funtions - see here[^].
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900