Questions in topic: "round"
http://ask.sqlservercentral.com/questions/topics/single/720.html
The latest questions for the topic "round"How to chop-off the decimal digits without allowing the rounding?
http://ask.sqlservercentral.com/questions/111796/how-to-chop-off-the-decimal-digits-without-allowin.html
In one of the procedures, I have a temp table, designed to be exactly the same as the destination table, wherein the data will be finally dumped. A column of that temp table is
rate decimal (6,5) not null
I will be storing decimal data into this, which comes computed from another part of the stored procedure, and therefore the digits after the dcimal can sometimes exceed 5 (example 0.01263789). When I try to store data in the rate column, it is getting automatically rounded-off to 0.01264. But I want the final value as 0.01263.
Is there a way in SQL Server 2008 that I can simply chop-off the decimal digits without allowing the rounding?Wed, 16 Apr 2014 08:23:11 GMTnidheesh.r.pillaiHow do I take calced Money field to next whole $1,000?
http://ask.sqlservercentral.com/questions/107152/how-do-i-take-calced-money-field-to-next-whole-100.html
What is the easiest way to take a SQL Money field that has been calculated from a variety of variables to the next whole 1,000 dollars ... as in not Rounding to nearest 1,000 but taking for example $33,125.10 to $34,000 ? Thanks, LarryMon, 07 Oct 2013 17:46:41 GMTLarryWhiteEagleSSIS Derived Column: Round or Floor
http://ask.sqlservercentral.com/questions/42784/ssis-derived-column-round-or-floor.html
I ran into something perculiar in SSIS today.<br>
In a Derived Column package I was trying to truncate a numeric value to an integer, like this
(DT_I4)[MyNumericValue]
It turns out that this does not do a truncate, but it rounds (up or down) to the nearest integer.<br>
So I had to do this to get it to truncate:
(DT_I4)FLOOR([MyNumericValue])
I tried searching for an answer, but was not able to find any.<br>
Now there is an explaination to be found.Thu, 30 Jun 2011 00:39:14 GMTHenrik Staun PoulsenRound a number to 2 decimal places
http://ask.sqlservercentral.com/questions/29479/round-a-number-to-2-decimal-places.html
I have a procedure that when run returns a value for Price as 3026.3590
I want this to be 3026.60
CREATE PROCEDURE spCharterPrice(@CharTrip NUMERIC)
AS
DECLARE
@FuelCharge money = 0.79 -- VARIABLE PER GALLON FUEL RATE
, @WaitCharge money = 112.50 -- VARIABLE PER HOUR WAIT RATE
, @Price decimal(10,2)
BEGIN
SELECT C.CHAR_TRIP
, SUM (([MOD_CHG_MILE]*[CHAR_DISTANCE]) + ([CHAR_FUEL_GALLONS]* @FuelCharge) + ([CHAR_HOURS_WAIT]* @WaitCharge)) as Price
FROM AIRCRAFT A Inner Join CHARTER C on A.AC_NUMBER = C.AC_NUMBER
Inner Join MODEL M on A.MOD_CODE = M.MOD_CODE
WHERE C.CHAR_TRIP = @CharTrip
GROUP BY C.CHAR_TRIP, C.AC_NUMBER
ENDSun, 21 Nov 2010 05:18:14 GMTrawilkenhow to round 2.2875 to 2.29
http://ask.sqlservercentral.com/questions/28922/how-to-round-22875-to-229.html
declare @d decimal
set @d='2.2875'
select round(@d,0)
i need to round it to 2.29...Wed, 10 Nov 2010 00:00:49 GMTMuraliConvert Money to varchar with no rounding
http://ask.sqlservercentral.com/questions/23908/convert-money-to-varchar-with-no-rounding.html
<p>Hi All I need some help, this is my first post.</p>
<p>I have this: 3416.65</p>
<p>I need to end up with this: 0341665</p>
<p>What I get when I try to cast(amount as Char(7)) is 3417</p>
<p>I can't figure out how to stop the rounding, I've tried varchar etc... </p>
<p>I'm ok with casting the left zeros, but how can I make the number appear correctly in my fixed file format.</p>
<p>Thanks, John B</p>Tue, 10 Nov 2009 18:57:44 GMTJohn B