Need Help

  • Nita Reddy

    SSCarpal Tunnel

    Points: 4158

    I want to get output as

    X hours and x minutes ( 1 hours and 30 minutes) how do I get output from below query


    CAST((rs.redo_queue_size/rs.redo_rate/60.0) as decimal(10)) [estimated_recovery_time_minutes]

    from sys.availability_replicas r

    inner join sys.dm_hadr_database_replica_states rs on r.replica_id = rs.replica_id

    Right now I am getting 200 Minutes, but I need 3 hours and 20 minutes



  • Mike01


    Points: 11282

    I don't have any data returned when I run your query, but could you run something like this?


    declare @i int = 200

    select @i/60 as hours, @i % 60 as minutes

    For better, quicker answers, click on the following...

    For better answers on performance questions, click on the following...

  • Nita Reddy

    SSCarpal Tunnel

    Points: 4158

    Thanks it worked for me


    Thanks once again

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply