Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Round to next 5 value
Message
De
07/03/2007 14:49:09
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01201576
Message ID:
01201743
Vues:
12
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform