Jul 28 2021 02:34 PM
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
Jul 29 2021 10:35 PM
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
Jul 30 2021 04:40 AM
Jul 30 2021 06:19 PM
SolutionHi @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