Dear All,
I need to get Actual start date time and End date time in completed batch job to store in temporary table
*This post is locked for comments
yeah you can take it form BatchJobHistory Table
https://msdn.microsoft.com/en-us/library/cc604388(v=ax.50).aspx
you may filter this table with status field where status is finished or 4(in ssms)
hai Sohaib ,
1.) Is it possible to get last finished job actual date time and end date time ...
2.) My job names is dynamic get from client so that how to get job start date time and end date time
thanks for ur reply ...
yeah on sql server you can write it like following
select * from batchjobhistory
order by batchjobhistory.STARTDATETIME desc
if you want to get only one record you may use max of startdatetime or enddatetime
if you are writing query on ax, you may write as under
BatchJobHistory localBatchJobHistory; ; ttsBegin; while select firstOnly10 localBatchJobHistory order by localBatchJobHistory.StartDateTime desc where localBatchJobHistory.Status == BatchStatus::Finished { info(strFmt("StartDateTime: %1 EndDateTime:%2",localBatchJobHistory.StartDateTime,localBatchJobHistory.EndDateTime)); } ttsCommit;
note that I am using keyword firstOnly10 to select only top 10 records to make execute my job fast, as there is lot of data.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Community Member 4
Nayyar Siddiqi 2
NNaumenko 2