Report Server - Calculate Execution Time

  • I have a couple of reports that are scheduled to run.

    I have the following query:

    SELECT ReportSchedule.ReportID, CONVERT(varchar,ExecutionLog.TimeStart,100) AS 'Start', CONVERT(varchar,ExecutionLog.TimeEnd,100) AS 'End'

    FROM ReportSchedule INNER JOIN

    ExecutionLog ON ReportSchedule.ReportID = ExecutionLog.ReportID

    WHERE ReportSchedule.ReportId = 'ec074e49-74d4-496c-bfe9-cb4cb9aeef43'

    I would like to add a field to display the execution time (i.e. 5 minutes) based on the TimeStart / TimeEnd.

    If anyone can help or has a better way of monitoring reports please post.

    Many Thanks,

    Phil.

    -------------------------------------------------------------------------------------
    A neutron walks into a bar. "I'd like a beer" he says. The bartender promptly serves up a beer. "How much will that be?" asks the neutron. "For you?" replies the bartender, "no charge."

    Two hydrogen atoms walk into a bar. One says, 'I think I've lost an electron.' The other says 'Are you sure?' The first says, 'Yes, I'm positive... '

    Tommy Cooper

  • Tried:

    SELECT ReportSchedule.ReportID, CONVERT(CHAR(5),ExecutionLog.TimeStart,114) AS 'TimeStart', CONVERT(CHAR(5),ExecutionLog.TimeEnd,114) AS 'TimeEnd',

    CONVERT(CHAR(5),TimeStart - TimeEnd,114) AS TimeTaken

    FROM ReportSchedule INNER JOIN

    ExecutionLog ON ReportSchedule.ReportID = ExecutionLog.ReportID

    WHERE ReportSchedule.ReportId = 'ec074e49-74d4-496c-bfe9-cb4cb9aeef43'

    Phil.

    -------------------------------------------------------------------------------------
    A neutron walks into a bar. "I'd like a beer" he says. The bartender promptly serves up a beer. "How much will that be?" asks the neutron. "For you?" replies the bartender, "no charge."

    Two hydrogen atoms walk into a bar. One says, 'I think I've lost an electron.' The other says 'Are you sure?' The first says, 'Yes, I'm positive... '

    Tommy Cooper

  • Try this:

    DATEDIFF(minute, ExecutionLog.TimeStart, ExecutionLog.TimeEnd) AS TimeTaken

  • Perfect, I played about with DATEDIFF.......

    Many Thanks,

    Phil.

    -------------------------------------------------------------------------------------
    A neutron walks into a bar. "I'd like a beer" he says. The bartender promptly serves up a beer. "How much will that be?" asks the neutron. "For you?" replies the bartender, "no charge."

    Two hydrogen atoms walk into a bar. One says, 'I think I've lost an electron.' The other says 'Are you sure?' The first says, 'Yes, I'm positive... '

    Tommy Cooper

  • I created a stored proc with the intention of allowing a user to run a report passing the stored proc the ReportId.

    What I hoped was to be able to do a SELECT, ReportId,ReportName (where report name is the user friendly name displayed under subscriptions) as the ReportId is meaningless. However it appears I am unable to retrieve the report name.

    Is this possible?

    Many Thanks,

    Phil.

    -------------------------------------------------------------------------------------
    A neutron walks into a bar. "I'd like a beer" he says. The bartender promptly serves up a beer. "How much will that be?" asks the neutron. "For you?" replies the bartender, "no charge."

    Two hydrogen atoms walk into a bar. One says, 'I think I've lost an electron.' The other says 'Are you sure?' The first says, 'Yes, I'm positive... '

    Tommy Cooper

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply