Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Datediff

Author  Topic 

netwerkassist
Starting Member

13 Posts

Posted - 2008-05-05 : 12:44:00
I'm trying to get the actual runtime of jobs running on our system. We have 2 columns that relate to the job times, jobstart time (STARTDTTM)and jobend time (ENDDTTM).

The format of the data in these columns would be like '2008-04-30 06:43:23.117'
So what I was looking for was to find the difference between the 2 columns that would give me the net job run time.

Appreciate insight

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-05 : 12:55:13
SELECT DATEDIFF(ss,jobstarttime,jobruntime) AS jobtime from Table
if you want time in seconds

provided jobstarttime and jobendtime are both datetime fields. Else cast them to datetime using CAST() function and then apply DATEDIFF.
Go to Top of Page

netwerkassist
Starting Member

13 Posts

Posted - 2008-05-05 : 15:33:48
Thnxs this is just what I'm looking for.
Cheers!
Go to Top of Page
   

- Advertisement -