Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
loveyaseen
Starting Member
1 Post |
Posted - 2007-10-31 : 09:43:55
|
Can somebody please help me with the implementation of a logic in round off to the left of a decimal point.Something like this in excel "=ROUND(x/12*31%,-2)" is to be implemented in SSIS. The Round function in the derived column is not permitting -2 for the length parameter. Please helpValue x Excel SSIS627900 16200 16221187000 4800 4831277760 7200 7175763000 19700 197111387500 35800 358441465200 37900 378512725000 70400 70396292800 7600 7564317200 8200 8194The table lists the values for X in the formula and the respective result calculated by Excel. I would want SSIS to give the same results like excel is giving. Please help me to make it work. |
|
tm
Posting Yak Master
160 Posts |
Posted - 2007-10-31 : 10:22:49
|
There are various ways to do this.If you use round in dataset (use T-SQL) you can use round(SomeValue, -2)If you are using expression in the report you can use either:=round((SomeFieldValue / 100), 0) * 100Example: =round((16221 / 100, 0) * 100OR=someFieldvalue - (someFieldvalue Mod 100)Example: =16221 - (16221 Mod 100) |
 |
|
tm
Posting Yak Master
160 Posts |
Posted - 2007-10-31 : 10:32:44
|
Oops .. Sorry I am giving wrong info. I was looking at SSRS. Sorry! |
 |
|
tm
Posting Yak Master
160 Posts |
Posted - 2007-10-31 : 10:44:37
|
loveyaseen, It is basically the same in SSIS.In the derived columns use:round((SomeFieldValue / 100), 0) * 100Example: round((16221 / 100, 0) * 100ORsomeFieldvalue - (someFieldvalue % 100)Example: 16221 - (16221 % 100) |
 |
|
|
|
|