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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL adding Time?

Status
Not open for further replies.

rsunra

IS-IT--Management
Sep 30, 2003
53
0
0
AU
G'day

I want to add a Varchar field that is in the format HH:mm:ss I have no problem selecting and converting it but How can I just get the SUM of all selected fields



SELECT ( CONVERT (datetime , Call_duration , 14 )
FROM SMDR


Something like


SELECT SUM ( ( CONVERT (datetime , Call_duration , 14 ) )
FROM SMDR


Thanks for you help and cheers

Rich
 
An option would be to convert the HH:mm:ss strings to seconds, sum them up, and then convers back to HH:mm:ss.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top