Round to four decimal places in SSIS dervied column

M S Reshman Mazhoodha 26 Reputation points
2021-09-07T09:03:55.517+00:00

I have a query ((DT_DECIMAL,2)[Coulmn1] / (DT_DECIMAL,2)[Column2]) + 0.0224. This query gives me a result 0.584900000. I need to round this to 4 decimal places. Tried giving ROUND([OutputColumn],4) but still getting the same output. How to remove those zeros and round to 4 decimal places? The expected output is 0.5849.

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,496 questions
0 comments No comments
{count} votes

Accepted answer
  1. ZoeHui-MSFT 34,591 Reputation points
    2021-09-07T09:14:00.703+00:00

    Hi @M S Reshman Mazhoodha ,

    You may use below query for a try.

    (DT_DECIMAL,4)(((DT_DECIMAL,2)Coulmn1 / (DT_DECIMAL,2)Coulmn2) + 0.0224)

    129770-screenshot-2021-09-07-171511.jpg

    Regards,

    Zoe


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    Hot issues October

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. M S Reshman Mazhoodha 26 Reputation points
    2021-09-07T09:49:57.44+00:00

    @ZoeHui-MSFT conversion works fine now. But mapping is failing as it was previously DT_Numeric and now it is DT_Decimal. Should I convert as DT_Numeric again and how?

    In Union All I am not able to map those columns. I am getting the following error.

    129911-error.jpg