Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: SSIS
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 Smile | :)

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

  Print Answers RSS
Your Filters
0 Shai Vashdi 458
1 Tadit Dash 300
2 Sergey Alexandrovich Kryukov 250
3 OriginalGriff 173
4 Peter Leow 130
0 Sergey Alexandrovich Kryukov 9,435
1 OriginalGriff 5,498
2 Peter Leow 4,230
3 Maciej Los 3,540
4 Abhinav S 3,353

Advertise | Privacy | Mobile
Web04 | 2.8.140415.2 | Last Updated 23 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid