Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DATETIME functions

Status
Not open for further replies.

bstacy1

Technical User
May 21, 2002
11
US
Hello all, I hope someone can help answer this question.

I have a field containing a number value for seconds. For example:

Employee BreakTime
---------- ----------
JohnDoe 1800

Is there a function that can be utilized in a query that would allow me to convert the 1800 seconds into a value showing hours/minutes/seconds such as:

00:30:00

Is something like this possible? If so can anyone help point me in the right direction?

Thanks,
 
If there is only one function, i don't know it, but a way to do it could be:

Code:
select seconds(convert(time,'00:00:00.000'),BreakTime) from Table

Hope this helps,

David.
 
hi bstacy1

this is a key:
hour:min:sec
hour:BreakTime/3600
min:(BreakTime-hour*3600)/60
sec:(BreakTime-(BreakTime/60)*60))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top