Start Free Trial
Come for the solution, stay for everything else.
Start Free Trial
Change duration in seconds into hh:mm:ss format
I have a table A with column duration (int) and I would like to view the duration (initially in seconds) in hh:mm:ss format.
What is the sql statement to convert the seconds into the mentioned format (hh:mm:ss)?
Microsoft SQL Server
8/22/2022 - Mon
so add the duration to 1st jan 1900
then convert it back to character using format 108 which is just time....
should work as long as duration is less than 24hours...
ASKER CERTIFIED SOLUTION
Log in or sign up to see answer
Become an EE member today
7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Sorry Lowfatspread for duplicate post
Lowfatspread was the first to come with the solution,
mine is exactly the same although the syntax slightly differs
'19000101' is the 'root' date and is stored internally as 0
I feel miserable for getting the points that LFS deserved
my apologies again
I'm OK for the points to be reaffected
Or I can post a "points for LFS" question
Your help has saved me hundreds of hours of internet surfing.
no problem hilaire
Plans and Pricing
Certified Expert Program
© 1996-2022 Experts Exchange, LLC. All rights reserved. Covered by US Patent