Thinking about sumations

On button action I am writing to a tag called shiftreset a value of 1.
Inside my group, my items are set to reset when this tag is = to 1
It looks like it is working how I had wanted it to work, resetting when I click the button and creating a new row in my table.
However, I never reset the tag to 0… how is it not resetting my hour meter every second when the tag value is always a 1?

Looking a little further down the line here,
I would like to pick the last item in one of these columns in my table out and display it in a window.
I would like to indirectly reference which motor I need to value for as well…
Where could I implement code and how?
I have something like this now:

Label Text binded to:

DECLARE @MyVar VARCHAR(50) = ‘dbo.motorrun.’ + ‘{Root Container.MotorID}’
select (@MyVar) from dbo.motorrun
where last(timestamp)

This won’t work… Even if I take out the Where, it only displays dbo.motorrun.MOTOR 101 instead of a value in the column