declare @NumberOfBeats int; set @NumberOfBeats = (111 * 4);

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

declare @NumberOfBeats int;
set @NumberOfBeats = (111 * 4);
declare @LengthOfSong time;
set @LengthOfSong = '00:03:21:921';
declare @LengthInSeconds int;
set @LengthInSeconds = (
  select convert(
    int, 
    datediff(
      second, 
      current_timestamp, 
      (current_timestamp + '00:03:21:921')
    )
  )
);
-- select @LengthInSeconds;
-- Result is 202 seconds
select cast(
  ((@NumberOfBeats / @LengthInSeconds) * 60)
as decimal(6,3)
);

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results