Question : How to convert seconds to hh:mm:ss in a sql query

Hi.

I'm new to this but can anyone help me with how to convert seconds to hours:minutes:seconds in a sql query.

My query is like this:

"select duration from tablename"

The column duration returns seconds and I want to format it in to hh:mm:ss in the statement.

Thanks.
Toti

Answer : How to convert seconds to hh:mm:ss in a sql query

in your case, it will be

select convert( char(8), dateadd( ss, duraction, '00:00:00' ), 108 )
from tablename
Random Solutions  
 
programming4us programming4us