Questions in topic: "round"
https://ask.sqlservercentral.com/questions/topics/single/720.html
The latest questions for the topic "round"SQL: How to distribute records to employees based on their highest capacity available?
https://ask.sqlservercentral.com/questions/143115/sql-how-to-distribute-records-to-employees-based-o.html
Hi,
As per our requirement, I should assign records to employees based on their capacity and category and other attributes. As per the earlier post, i was able to assign records evenly. But I need to look at the employee capacity also. For example, if an employee has 30 capacity, he can get assigned more records than the person with lowest capacity.
If that employee reaches 0 capacity, i should take him of the list and start assigning. I tried a cursor for row by row processing and round robin as well. But i am not getting desired output. Please advise.rounddistributedcapacityTue, 23 May 2017 21:22:17 GMTarunaponugupatiHow to convert a decimal to the nearest quarter?
https://ask.sqlservercentral.com/questions/133825/how-to-convert-a-decimal-to-the-nearest-quarter.html
How do I convert a decimal to the nearest 1/4th?
For ex:
0.3 ------ 0.25
10.85 ---- 10.75
85.9 ----- 86.00decimalroundMon, 21 Sep 2015 21:57:26 GMTSanketJJProblem with Date Math
https://ask.sqlservercentral.com/questions/122373/problem-with-date-math.html
Hi SQL Gurus,
I can't seem to find the answer to this simple problem. I am trying to convert a datetime to a numeric(5,2). I only want the minutes converted.
Here is my date:1899-12-30 08:30:00.000
Here is my attempt:
CAST(DATEPART(minute, HC_ApptDetail.TimeFrom) / 60 AS numeric(5, 2)) AS starttimeM_t
The result: 0.00 it should be 0.50
What am I missing?convertrounddatepartcastWed, 29 Jul 2015 18:16:22 GMTcbrown197How to chop-off the decimal digits without allowing the rounding?
https://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?sql-server-2008decimalroundWed, 16 Apr 2014 08:23:11 GMTnidheesh.r.pillaiHow do I take calced Money field to next whole $1,000?
https://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, LarryroundmathMon, 07 Oct 2013 17:46:41 GMTLarryWhiteEagleSSIS Derived Column: Round or Floor
https://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.ssistruncateroundmathematicsThu, 30 Jun 2011 00:39:14 GMTHenrik Staun PoulsenRound a number to 2 decimal places
https://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
ENDt-sqlroundSun, 21 Nov 2010 05:18:14 GMTrawilkenhow to round 2.2875 to 2.29
https://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...t-sqldecimalroundWed, 10 Nov 2010 00:00:49 GMTMuraliConvert Money to varchar with no rounding
https://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>sql-server-2005convertroundTue, 10 Nov 2009 18:57:44 GMTJohn B