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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert string to integer

Status
Not open for further replies.

impulse24

IS-IT--Management
Jul 13, 2001
167
US
Hello,

I have a table which has a numeric value stored as a string. I want to do a > query, but since the value is a string this isn't working. In VB i can do a Cint. What is the function in SQL that does this?
 
depends on what server you are using in MS SQL server it would be either cast or convert.
 

CAST is an ANSI-92 SQL standard.

Select CAST(stringcol As int) As intcol From table

OR

Select CAST(stringcol As decimal(8,2)) As deccol From table


Terry L. Broadbent
Life would be easier if I had the source code. -Anonymous
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top