Click here to Skip to main content
15,884,013 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:
C#
CAST(MyVarcharCol AS INT)
 CONVERT(INT, MyVarcharCol)
 
Share this answer
 
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)
 
Share this answer
 
Use the Cast or Convert funtions - see here[^].
 
Share this answer
 

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