Thinking about sumations

The hour meter reset is performed on the rising edge and latched. It won't reset again until it sees a 0 first.

For the query, just use a SQL Query binding on the label text:

SELECT TOP 1 "MOTOR  {Root Container.MotorID}" FROM dbo.motorrun ORDER BY t_stamp DESC

So, what you're doing there is ordering the results by the timestamp (in reverse), and limiting it to 1 result. As for the column name, you can just bind in references directly in the query. In this case it's made a tad more complicated by the fact that there appears to be a space between "MOTOR" and the number in the column name... so you have to quote the column name in the query.

Hope this helps,