SQL Query for "Next Start" Date

trueter (21 posts)
November 14, 2013 12:24 PM
Accepted Answer

Hi,

I'm trying to write a SQL query that will return the "Next Start" date and time for a group of Job OIDs.  I see in the Console there is a "Next Start", "Last Start", and "Last Finish" column in the job window.  Can you give me a SQL query that will return the "Next Start" time for a give job OID? 

 

Thanks,

Tim

Bill Staff (601 posts)
November 14, 2013 12:39 PM
Accepted Answer

All those values are stored in the JobStatus table. The "Status" column in the Job table points to the OID of the JobStatus record. So given a job OID you want

select NextStart from JobStatus where oid=(select status from job where oid='job oid')

The date/time values will be in the timezone of the server. There is a corresponding "TZ" column for each (e.g., NextStartTZ) that gives the timezone offset

trueter (21 posts)
November 14, 2013 12:40 PM
Accepted Answer
Thanks Bill!

Replies are disabled for this topic.