x
login about faq Site discussion (meta-askssc)

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 '11 at 03:12 AM in Default

aRookieBIdev gravatar image

aRookieBIdev
2k 24 40 46

What code are you using to get this output?

Jul 19 '11 at 03:34 AM Mrs_Fatherjack

I am trying to get this done using expressions in DataConversionTransformation .

Jul 19 '11 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 '11 at 04:38 AM

Tim gravatar image

Tim
31.5k 20 31 116

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 '11 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 '11 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.

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x751
x41
x34
x22

asked: Jul 19 '11 at 03:12 AM

Seen: 1322 times

Last Updated: Jul 19 '11 at 03:12 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.