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

query Job

Status
Not open for further replies.

199002003

MIS
May 3, 2006
129
US
Hi I like to run a query that shows the following:

I want to see the specific date jobs only say 11-26-06 in my history file, how do I run it?

 
What version of SQL are you using? It might make a difference on what catalog views we tell you to use.



Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
 
This gets you both the Job Name and the history. Be aware there is one line for each job step, so you may want to filter it down.

Also, you'll want to change the date as needed.

Code:
Select sj.[name], sjh.*
from sysjobhistory sjh
join sysjobs sj
on sjh.job_id = sj.job_ID
where left(convert(varchar(10),run_date),4) + '-' + 
		substring(convert(varchar(10),run_date),5,2) + '-' + 
		right(convert(varchar(10),run_date),2)>= '11/27/2006'



Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top