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

Equivalent of the "VAL" function

Status
Not open for further replies.

cyork

MIS
Apr 4, 2001
34
CA
Hi,

I have a column with numbers in it but the data type is text. I would like to take the numerial value of these and update them into another (numeric) column. In Access I would use the VAL function...what can I use in SQL Server?

Thank you,

Chris

 
Hello!

Try this:

declare @str varchar(15)

set @str='45'

SELECT CONVERT(integer, @str)
 
Hello!

Try this:

declare @str varchar(15)

set @str='45'

SELECT CONVERT(integer, @str)

Best Regards,

PEDRO VIEIRA - PORTUGAL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top