We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

SQL rounding problem

Medium Priority
345 Views
Last Modified: 2012-08-13
Hello EE,

lets say I have this code:

DEClare @test decimal(10, 4)

set @test = 333.3334


How could I do a select that returns 2 decimals, but   like that:   333.34

because I have a 4 at the end... I would like to show 333.34  
the thing is that I saved inside table as money and it saves 4 decimals. I have a 4 at the fourth decimal.

any ideas.. ?
Comment
Watch Question

Ephraim WangoyaSoftware Engineer
CERTIFIED EXPERT

Commented:

select Round(@test, 2)
Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
ahhh floor works....!

thanks angel

Author

Commented:
sorry I meant Ceiling  *100
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.