Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting Char(12) to Numeric
Message
From
27/03/2011 15:30:57
 
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01505130
Message ID:
01505132
Views:
38
>Michel, unless I'm missing something....you want to take an alphanumeric column that contains hyphens, and convert it to an integer. (Which, unless someone knows something I don't, you can't do). A question....why do you need it as a numeric?

The fields have 506-111-2222 format for all entries. This is presently defined as Char(12). I want to transfer that data as numeric, thus without the dashes, into a Numeric(15) field. This is a standard that should have been applied to that table since a while as, at save time, we collect only the digits. Then, we can format into a universal format at display time. Otherwise, some users enter the telephone number in one way such as (506) 111-2222, some others as 5061212121, etc. This, of course, if for Canada and United States only. So, the goal is to only keep the digits and obtain a numeric value out of it into the temporary field I have created. Then, I will remove the Tel field and rename the temporary field into the Tel name. The framework knows how to deal with the rest when a field is defined as a telephone number.
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform