Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

convert into second Expand / Collapse
Author
Message
Posted Thursday, June 13, 2013 9:58 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Saturday, April 19, 2014 8:15 PM
Points: 42, Visits: 207
Can you please help me converting datediff into seconds. I'm using SQL 2008 , the following command error out with pass valid argument.

round((ENDDTTM - BEGINDTTM) * 24 * 60 * 60) || ' seconds' as PROCSTIME .

Thank you
Post #1463181
Posted Thursday, June 13, 2013 10:02 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 8:09 PM
Points: 23,270, Visits: 31,985
kshatriya24 (6/13/2013)
Can you please help me converting datediff into seconds. I'm using SQL 2008 , the following command error out with pass valid argument.

round((ENDDTTM - BEGINDTTM) * 24 * 60 * 60) || ' seconds' as PROCSTIME .

Thank you


SELECT DATEDIFF(SECOND, BEGINDTTM, ENDDTTM) from YourTable;




Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1463186
Posted Thursday, June 13, 2013 10:14 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Saturday, April 19, 2014 8:15 PM
Points: 42, Visits: 207
Thank you. it worked.
Post #1463197
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse