Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting Char(12) to Numeric
Message
De
27/03/2011 15:22:31
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Getting Char(12) to Numeric
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01505130
Message ID:
01505130
Vues:
116
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform