SSIS Data type conversion

Hi All,

I am trying to convert a string datatype to decimal data type using a Data Conversion Transformation.

My input is 1200080

my desired output is 12000.80 But what i get is 1200080.00

How do i include last two chars in the string as decimal.

Thanks, Nk
more ▼

asked Jul 19, 2011 at 03:12 AM in Default

aRookieBIdev gravatar image

2.3k 52 57 61

What code are you using to get this output?
Jul 19, 2011 at 03:34 AM Mrs_Fatherjack
I am trying to get this done using expressions in DataConversionTransformation .
Jul 19, 2011 at 03:57 AM aRookieBIdev
(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first
In my experience when I have needed to convert a value like 1200080 to 12000.80 I simply multiply by .01
more ▼

answered Jul 19, 2011 at 04:38 AM

Tim gravatar image

36.4k 38 41 139

yes , thats how i have done it now.Was just curious to see if there is a proper way to type cast it.
Jul 19, 2011 at 05:16 AM aRookieBIdev
I have yet to encounter one, every time I have tried converting to decimal with adding decimal places it just adds a period and however many zeros I specify to have decimal places.
Jul 19, 2011 at 05:37 AM Tim
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Jul 19, 2011 at 03:12 AM

Seen: 2039 times

Last Updated: Jul 19, 2011 at 03:12 AM