Round Money Field to 2 decimals

How do you round a money field to 2 decimals?

I would have thought rount(field, 2) would work but it doesn't

I only want to return:


Original Value = 12.040506  -----   Return Value =  12.04

Thanks
DJMoonLightAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steve BinkCommented:
What does yours return?  This should be the proper syntax:

round(myfield, 2)

Syntax
 
ROUND ( numeric_expression, length [ , function ] )
 

Arguments
numeric_expression
An expression of the exact numeric or approximate numeric data type categories, or types that are implicitly convertible to float.

length
The precision to which numeric_expression is to be rounded. When length is a positive number, numeric_expression is rounded to the number of decimal places specified by length. When length is a negative number, numeric_expression is rounded on the left side of the decimal point, as specified by length.

function
The type of operation to perform. When function is omitted or has a value of 0 (default), numeric_expression is rounded. When a value other than 0 is specified, numeric_expression is truncated.

0
DJMoonLightAuthor Commented:
Mine returns the number rounded to that many in the decimal..
For example:

17.701010 = 17.700000

 
I only want 17.70 returned

0
DonKronosCommented:
I think the round is working.  maybe you are assigning the result to a float or other numeric datatype.  You can do this instead of using round.

Declare @RoundValue decimal(18,2)

select @RoundValue = CAST([Original Value] as decimal(18,2))

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Aneesh RetnakaranDatabase AdministratorCommented:
CAST(round(myfield, 2) as Numeric(18,2))
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.