Browse FAQs

A query to show the most recent timestamp for each device

Published date: 26 August 2019

Issue
A SQL statement to show the most recent timestamp, data was logged, for any source in the system.

Product Line
Power Monitoring Expert (8.0 and higher)

Environment
SQL Server Management Studio (SSMS)

Cause
Some devices may have stopped logging. A query is necessary to quickly show the most recent time, data was logged.

Resolution
*Warning: Irreparable database damage can occur. This procedure should only be performed by users familiar with SQL Server Management Studio. Databases should be backed up prior to performing this procedure.* 
In SSMS execute the following query:
 
USE ION_Data
SELECT    DL2.SourceID, Src.Name AS 'Source Name', MAX(DL2.TimestampUTC) AS 'Time in UTC'
FROM      DataLog2 AS DL2
INNER JOIN Source AS Src
ON DL2.SourceID = Src.ID
GROUP BY DL2.SourceID, Src.Name

Below is an example of the result:


 

Was this helpful?

What can we do to improve the information ?

Can't find what you are looking for?

Reach out to our customer care team to receive information on technical support, assistance for complaints and more.