November 25, 2014 at 2:31 am
Hi,
I'm using this query to round off the numbers and this round off the next value. Now I need to round off to the nearest value means if the value is 45.67 then the value should be 45.
parsename('$' + convert(varchar,convert(money,round(sum(Column1 * Column2),0)),1),2)
Really appreciate any suggestions.
November 25, 2014 at 6:23 am
Cast to int, ie
SELECT CAST(45.67 as int)
will give you 45
Far away is close at hand in the images of elsewhere.
Anon.
November 25, 2014 at 6:31 am
Have you tried the FLOOR function?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 25, 2014 at 8:24 am
Or you can use the truncate option of ROUND()
SELECT ROUND(45.67, 0, 1)
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply