Click here to Skip to main content
13,140,231 members (46,960 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hello friends,
I'm importing data from excel and performing derived column on REV column before dumping the data in the destination table.

My problem is, suppose the column contains 6180.00 and I write expression in derived column as below
6180.00 / 1000

It gives me 6.17 as output

But if i try following in SQL Server
select 6180.00/1000

It gives me 6.1800000 as output

Can I know what is happening and why
What i want as final result is 6.18

Any idea how to do it?

Thanks in advance
Posted 22-Nov-12 19:57pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

So what I did is, I would force SSIS to compute higher precision value and then ROUND it to the precision I want.
So following gave me required output

ROUND(((DT_DECIMAL,4)[REV]) / ((DT_DECIMAL,4)1000),2)

Hope this helps Yu :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170915.1 | Last Updated 23 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100