SET @intinterval = cast(10 * (@b / 1000.0) * (86400.0 / @a) as int) / 10.0
eller
SET @intinterval = cast(@b * 864.0 / @a as int) / 10.0
SET @intinterval = cast(10 * (@b / 1000.0) * (86400.0 / @a) as int) / 10.0
eller
SET @intinterval = cast(@b * 864.0 / @a as int) / 10.0