Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

Query for the history of a jobgroup

Hello, 

I'm trying to get a report of the history of a job group for a given period of time (lets just say last 5 weeks).  Basically I want everything in the history tab of the jobgroup. Can anyone assist with a query?

1 ACCEPTED SOLUTION

Accepted Solutions
Silver

Hi Justin, Try this query:

Hi Justin,

 

Try this query:

 

SELECT
dbo.jobrun.jobrun_id AS [Job No.],
dbo.jobrun.jobrun_proddt AS [Date],
dbo.jobmst.jobmst_prntname AS [JOB GROUP],
dbo.jobrun.jobrun_status AS [Status],
dbo.jobrun.jobrun_esttime AS [Est Start Time],
dbo.jobrun.jobrun_time AS [Act Start Time],
[Act End Time] = DATEADD(s,dbo.jobrun.jobrun_duration,dbo.jobrun.jobrun_time),
dbo.jobrun.jobrun_duration AS [Act Duration],
dbo.jobrun.jobrun_reruns AS [Reruns]

FROM
dbo.jobmst INNER JOIN
dbo.jobrun ON dbo.jobmst.jobmst_id = dbo.jobrun.jobmst_id
WHERE
dbo.jobrun.jobrun_proddt BETWEEN 'Insert_start_date' AND 'Insert_end_date' AND
dbo.jobmst.jobmst_prntname = 'Insert_job_group_name'
ORDER BY [Date]

 

Comments:

dates can be entered as m/dd/yyyy

WHERE dbo.jobmst.jobmst_prntname = or LIKE can be used. = is used when looking for an exact match, whereas LIKE is looking for a partial text match.

 

BR,

Derrick Au

1 REPLY
Silver

Hi Justin, Try this query:

Hi Justin,

 

Try this query:

 

SELECT
dbo.jobrun.jobrun_id AS [Job No.],
dbo.jobrun.jobrun_proddt AS [Date],
dbo.jobmst.jobmst_prntname AS [JOB GROUP],
dbo.jobrun.jobrun_status AS [Status],
dbo.jobrun.jobrun_esttime AS [Est Start Time],
dbo.jobrun.jobrun_time AS [Act Start Time],
[Act End Time] = DATEADD(s,dbo.jobrun.jobrun_duration,dbo.jobrun.jobrun_time),
dbo.jobrun.jobrun_duration AS [Act Duration],
dbo.jobrun.jobrun_reruns AS [Reruns]

FROM
dbo.jobmst INNER JOIN
dbo.jobrun ON dbo.jobmst.jobmst_id = dbo.jobrun.jobmst_id
WHERE
dbo.jobrun.jobrun_proddt BETWEEN 'Insert_start_date' AND 'Insert_end_date' AND
dbo.jobmst.jobmst_prntname = 'Insert_job_group_name'
ORDER BY [Date]

 

Comments:

dates can be entered as m/dd/yyyy

WHERE dbo.jobmst.jobmst_prntname = or LIKE can be used. = is used when looking for an exact match, whereas LIKE is looking for a partial text match.

 

BR,

Derrick Au

95
Views
0
Helpful
1
Replies
CreatePlease to create content