Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Round to next 5 value
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01201576
Message ID:
01201743
Views:
13
Oops, my bad, sorry. I was using an integer in the calculation, not a decimal. I see the decimal will be promoted to the next higher multiple of 5. I assume that's what you want and not rounding and you're good to go.

Bill

>Naomi
>
>Since my minutes values were Ints and not time value, I had to modify it how I initially stored the value
>
>
>
>declare @decDuration Decimal(10,2)
>declare @tiDuration int
>
>-- We are going to store the duration initially in a decimal so that we can
>-- round it to the nearest 5 minute value.  This will take care
>-- of 14,29,44,59 minute values
>
>set @decDuration=(Select defaultTime from coProc where procID=@tiProcID)
>
>-- Use the ceiling function to move it to the nearest 5 minute value
>set @tiDuration=Ceiling(@decDuration/5)*5
>
>declare @tiDurationIncrement int
>set @tiDurationIncrement = @tiDuration/15
>
>
>Thanks for the links and help.
>
>Kirk
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Previous
Reply
Map
View

Click here to load this message in the networking platform