declare @M int, @X int select @x = 35 -- This code does the work select @M = @x % 5 if ( @M > 2 ) select @x = @x + 5 - @m else select @x = @x - @m -- Display the value select @X>I have a value that represents duration, some of them are like 29, 14, 59. In my case these represent minutes, I'm looking for a way within a stored procedure to "round" them to the nearest 5 minute value.