Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Transferring character field into numeric field
Message
From
22/10/2012 11:59:34
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01555436
Message ID:
01555459
Views:
39
>Use CASE :
>
>SELECT ...
>       CASE WHEN ISNUMERIC(YourField+'e0') = 1
>                 THEN CAST(YourField as Numeric(xx, yy)
>            ELSE 0 END AS YourNumberField
>
Thanks, a condition case seems to be quite fine. In the mean time, we are looking into a resolution to fix the data also. So, additionnally, to place 0 as the value, based on some other fields, we might be able to calculate what was the value that was suppose to be there. If yes, a program will take care of that. If not, we'll then use that approach.
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
Reply
Map
View

Click here to load this message in the networking platform