Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Losing my decimals
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Import/Export
Divers
Thread ID:
00624764
Message ID:
00624842
Vues:
15
Scale was set to 0. All along I thought that percision was to the right of the decimal. You learn something new evry day.

__Stephen


>Thanks Serg. Unfortunatly in a simple declare it is working. But in the real world it's not going into the column properly.
>
>Here is the total part of the field list that is correct when run as a select but truncates to a 2, or 3 in an insert into:
>
>case
> when isnumeric(OldWBC ) = 1 AND ltrim(rtrim(OldWBC )) <> '.'
> then
> CAST( OldWBC AS numeric(9,5))
> else
> null
> end
>as Result,
>
>These are my actual values in the Character(30) 1.60000002384, 2.70000004768
>
>I have changed the column from numeric to decimal. Still no luck.
>
>__Stephen
>
>
><hr>
>>By default the lenght of character variable is 1. Change declare to
DECLARE @myval character(30)
>>
>>>I am trying to get character column (2.16598700) into a numeric (9) perc (18) column in another db.
>>>
>>>This is my issue:
>>>DECLARE @myval character
>>>SET @myval = '3.57366210'
>>>SELECT CAST(@myval AS decimal (10,9) )
>>>
>>>3.0000000
>>>
>>>How do I get the .57366210 to appear in the column as well as the 3. ?
>>>
>>>TIA
>>>
>>>__Stephen
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform