It is currently 22 Aug 2017 2:58


Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 05 Mar 2015 7:48 
Offline
Nouveau
Nouveau
User avatar

Joined: 21 Sep 2013 12:00
Posts: 48
Hi all ,

we have a requirement to find the job count which have executed in the previous month.
is der a query or utility through which this can be done

_________________
Anirudh


Top
   
PostPosted: 05 Mar 2015 4:47 
Offline
Nouveau
Nouveau

Joined: 16 Feb 2015 2:28
Posts: 2
Hi Anirudh,

You can try the below SQL query to find the list of jobs that executed (irrespective of failure or successful execution of the job) for the previous month.

SELECT [APPLGROUP]
,[SCHEDTAB]
,[NODEID]
,[ODATE]
,[OSCOMPMSG]
,[JOBNAME]
FROM [ctrlm700].[dbo].[CMR_AJF]
WHERE
(STATUS = 'Y'
OR
STATUS = 'N')
AND
STATE = '8'
AND
ODATE >= ( select DATEADD(MONTH, DATEDIFF(MONTH, 0,GETDATE()) - 1, 0) )
AND
ODATE <= ( select dateadd(month,datediff(month,0,GETDATE()),0) )



And below SQL query to find the list of jobs that executed successfully for the previous month:
SELECT [APPLGROUP]
,[SCHEDTAB]
,[NODEID]
,[ODATE]
,[OSCOMPMSG]
,[JOBNAME]
FROM [ctrlm700].[dbo].[CMR_AJF]
WHERE
STATUS = 'Y'
AND
STATE = '8'
AND
ODATE >= ( select DATEADD(MONTH, DATEDIFF(MONTH, 0,GETDATE()) - 1, 0) )
AND
ODATE <= ( select dateadd(month,datediff(month,0,GETDATE()),0) )


Regards,
Ankit


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited
The site created by Franck YOT. Images, logo, content and trademarks about Control-M products are property of BMC Software.
All the comments are property of their posters. Images, logo, content and design are © copyright by Scheduler-Usage.com. All Rights Reserved