Forum Discussion
JD2021
Jul 28, 2021Copper Contributor
how insert round function
hi guys,
i am a beginner in SQL .
This is my query
This is the result .
I want to convert the Annual_premium_In$ to a round figure.
How we can do that
Thanks in Advance
Hi JD2021 -- The query below will hopefully help you to get started. Take care.
SELECT age,nationality,mp, convert(float,case when mp = 106 then ROUND(MP*12/3.65,2) when MP = 79 THEN ROUND(MP*12/3.65,2) when MP = 53 THEN ROUND(MP*12/3.65,2) when MP = 35 THEN ROUND(MP*12/3.65,2) else ROUND(MP/3.65,2) end) as Annual_Premium_In$ FROM metlife..analysis
- olafhelperBronze Contributor
I want to convert the Annual_premium_In$ to a round figure.JD2021 , you already used the right function name ROUND
ROUND (Transact-SQL) - SQL Server | Microsoft Docs
- JD2021Copper Contributorwhere can put the round function on the above mentioned query thanks in advance
- bake13Microsoft
Hi JD2021 -- The query below will hopefully help you to get started. Take care.
SELECT age,nationality,mp, convert(float,case when mp = 106 then ROUND(MP*12/3.65,2) when MP = 79 THEN ROUND(MP*12/3.65,2) when MP = 53 THEN ROUND(MP*12/3.65,2) when MP = 35 THEN ROUND(MP*12/3.65,2) else ROUND(MP/3.65,2) end) as Annual_Premium_In$ FROM metlife..analysis