Convert seconds to a timestring

  • Comments posted to this topic are about the item Convert seconds to a timestring

    Wilfred
    The best things in life are the simple things

  • An alternative, using DATEADD and CONVERT

    select CONVERT (varchar(8),DATEADD(second,@duration,0),114)

  • WOW! :w00t::w00t: that was an easy one! Sometimes you're working on a solution which can be replaced by a very few lines ( I feel stupid :ermm::ermm::ermm: )

    Have a drink from me!

    Wilfred
    The best things in life are the simple things

  • Keep in mind that this only works up to 23:59:59. Anything greater than or equal to 24 hours (86,400 seconds) will not work. I have reports were we show some records with more than 24 hours and had to write a custom function.

  • robshobs (5/5/2010)


    Keep in mind that this only works up to 23:59:59. Anything greater than or equal to 24 hours (86,400 seconds) will not work. I have reports were we show some records with more than 24 hours and had to write a custom function.

    Excellent point, thanks.

  • Wilfred van Dijk (5/5/2010)


    WOW! :w00t::w00t: that was an easy one! Sometimes you're working on a solution which can be replaced by a very few lines ( I feel stupid :ermm::ermm::ermm: )

    Have a drink from me!

    Thanks for the feedback, glad to have contributed something useful.

    Now, about that drink ... 🙂

  • Thanks for the script.

Viewing 7 posts - 1 through 6 (of 6 total)

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