SQL question

pfd

Reputable Poster
I am trying to update F4106 (Base Prices) so that a price like $55.1234 gets rounded to $55.1200 and a price like $.0568 gets rounded to $.06. How do I achieve this using SQL? Since the number gets stored in the database as a whole#(without decimals) I cannot get Ceiling or Floor or Round to work. I tried multiplying by 100 and then dividing by 100 but this always rounds it down.

Thanks,
Matt
 
Try round((X *.0001),2) * 10000 where X is the value stored as a whole number.
 
I assume you're using SQL Server

SELECT FLOOR(x*100.0+0.5)/100.0
 
Back
Top