Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want round the amount to nearest rupee.

I.e. if I got 225 as amount it must be treat as 230.

And if 224 it must treat as 220.

How can it be done using roundoff in T-SQL?

share|improve this question

closed as off topic by Nick Chammas, Aaron Bertrand, Mark Storey-Smith, Martin Smith, Marian Jun 24 '12 at 14:54

Questions on Database Administrators Stack Exchange are expected to relate to database administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

WHat datatype are these values? – ypercubeᵀᴹ Jun 23 '12 at 8:24
datatype used is numeric(19,6) – Sivajith Jun 23 '12 at 8:33
Have you read this?: ROUND() function. – ypercubeᵀᴹ Jun 23 '12 at 8:36
This part: When length is a **negative** number, numeric_expression is rounded on the left side of the decimal point, as specified by length. – ypercubeᵀᴹ Jun 23 '12 at 8:45
Dude, just read the link ypercube sent you. He even highlighted the relevant part for you. Put some effort into answering your own question now that we've practically led you to its doorstep. – Nick Chammas Jun 23 '12 at 15:52
up vote 2 down vote accepted

You can use the Round() function.


Select Round(224,-1)

it returns the value 220

Select Round(225,-1)

it returns the value 230

Refer the following link

share|improve this answer

As the comments have stated you can use the ROUND() function

create table t
  rupee money

insert into t values (225)
insert into t values (224)
insert into t values (221)
insert into t values (226)
insert into t values (231)

select round(rupee, -1)
from t

See SQL Fiddle with Demo

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.