Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Reports (Ad-hoc SQL Queries)

Report Title

Last Updated

Total Scan Ingestion Time

11/8/2020

Description

Notes:

Total start to finish time for all Completed and Active Pending Scans

Parameters

Detail

Default

Active filter

This column currently remains true unless user modified via a SQL update script.

Number of scans included

The number after the TOP keyword can be adjusted or removed all together; this restricts the number of PendingScans included in this report. Ordering parameters also apply.

TOP 1000

Order

ASC: earliest scans

DESC: latest scans

ORDER BY createdDate DESC

SQL Query (MS SQL Server)

Code Block
languagesql
/* 
* Total start to finish time for all 'Completed' and 'active' Pending Scans 
* Result time unit: minutes
*/ 
SELECT
(DATEDIFF(millisecond,
			CONVERT(DATETIME2, oldestCreatedDate, 103),
			CONVERT(DATETIME2, latestEndDate, 103))/1000 / 60) AS totalTime
FROM
(SELECT 
 MIN(createdDate) AS oldestCreatedDate, MAX(modifiedDate) AS latestEndDate 
 FROM
(SELECT TOP 1000 * FROM NewPendingScan 
WHERE active = 1 AND pendingScanStatus = 'COMPLETED'
ORDER BY createdDate DESC) ps ) t ;