Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Article Discussions
»
Article Discussions by Author
»
Discuss content posted by wfvdijk
»
Convert seconds to a timestring
Convert seconds to a timestring
Rate Topic
Display Mode
Topic Options
Author
Message
Wilfred van Dijk
Wilfred van Dijk
Posted Thursday, April 29, 2010 2:39 PM
SSC Eights!
Group: General Forum Members
Last Login: Wednesday, March 06, 2013 12:56 AM
Points: 898,
Visits: 1,045
Comments posted to this topic are about the item
Convert seconds to a timestring
Wilfred
The best things in life are the simple things
Post #913275
nigel.
nigel.
Posted Wednesday, May 05, 2010 8:31 AM
Ten Centuries
Group: General Forum Members
Last Login: 2 days ago @ 7:31 AM
Points: 1,164,
Visits: 2,601
An alternative, using DATEADD and CONVERT
select CONVERT (varchar(8),DATEADD(second,@duration,0),114)
--
Nigel
Useful Links:
How to post data/code on a forum to get the best help
The "Numbers" or "Tally" Table - Jeff Moden
Post #916122
Wilfred van Dijk
Wilfred van Dijk
Posted Wednesday, May 05, 2010 9:06 AM
SSC Eights!
Group: General Forum Members
Last Login: Wednesday, March 06, 2013 12:56 AM
Points: 898,
Visits: 1,045
WOW!
that was an easy one! Sometimes you're working on a solution which can be replaced by a very few lines ( I feel stupid
)
Have a drink from me!
Wilfred
The best things in life are the simple things
Post #916171
robshobs
robshobs
Posted Wednesday, May 05, 2010 1:04 PM
SSC Rookie
Group: General Forum Members
Last Login: Monday, May 13, 2013 11:23 AM
Points: 41,
Visits: 268
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.
Post #916383
nigel.
nigel.
Posted Thursday, May 06, 2010 2:30 AM
Ten Centuries
Group: General Forum Members
Last Login: 2 days ago @ 7:31 AM
Points: 1,164,
Visits: 2,601
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.
--
Nigel
Useful Links:
How to post data/code on a forum to get the best help
The "Numbers" or "Tally" Table - Jeff Moden
Post #916725
nigel.
nigel.
Posted Thursday, May 06, 2010 2:33 AM
Ten Centuries
Group: General Forum Members
Last Login: 2 days ago @ 7:31 AM
Points: 1,164,
Visits: 2,601
Wilfred van Dijk (5/5/2010)
WOW!
that was an easy one! Sometimes you're working on a solution which can be replaced by a very few lines ( I feel stupid
)
Have a drink from me!
Thanks for the feedback, glad to have contributed something useful.
Now, about that drink ...
--
Nigel
Useful Links:
How to post data/code on a forum to get the best help
The "Numbers" or "Tally" Table - Jeff Moden
Post #916727
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.