Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting Char(12) to Numeric
Message
From
27/03/2011 15:22:31
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Getting Char(12) to Numeric
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01505130
Message ID:
01505130
Views:
115
I have a Tel field defined as Char(12). If I do this command:
SELECT Tel,CAST(Tel AS Numeric) FROM Site
I get:

"Error converting data type varchar to numeric."

Basically, I have a telephone field that I want to take its data and replace that into a Numeric(15) field which already exists. All telephone numbers have a 506-111-2222 format. The example above is just a short SQL command I was trying to execute as using Str() and concatening the 1-3, 5-7 and 9-12 characters into a numeric value did not do.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform