SOLVED

# how insert round function

Copper 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

3 Replies

# Re: how insert round function

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

# Re: how insert round function

where can put the round function on the above mentioned query thanks in advance
best response confirmed by JD2021 (Copper Contributor)
Solution

# Re: how insert round function

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)
FROM metlife..analysis``````

1 best response

Accepted Solutions
best response confirmed by JD2021 (Copper Contributor)
Solution

# Re: how insert round function

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)