Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Transferring character field into numeric field
Message
De
22/10/2012 11:59:34
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01555436
Message ID:
01555459
Vues:
38
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform