Thinking about sumations

The select query works perfectly for me now.
Thanks very much for that… My column names and motor IDs have white space which has caused problems for me since the beginning but I wanted to learn how to manage them.

How could I reset my tag that is the reset condition for my group items… this is how I am triggering the change on a button:

system.db.runUpdateQuery(“INSERT INTO motorrun (t_stamp) VALUES (CURRENT_TIMESTAMP)” )
system.tag.writeToTag(‘ShiftReset’, 1)

I was thinking that I could use a tag change client script that would simply reset the value to 0 after a minute of it being changed to a 1. Is this a good way to do it?
Is there a way to avoid all the settings for each item… like the reset conditions and the hour settings. Could I just set up all of my items similarly to a UDT architecture so I am not repeating settings 200 times?