Mike Arney
2017-10-23 19:07:37 UTC
I have a MSSQL table with the following columns and data types:
Topic -- nvarchar
Payload -- numeric
Timestamp -- datetime
id -- int
Here is some example data:
Topic Payload Timestamp id
STG/A/CycleStart 0 2017-10-23 15:37:56.697 1651
STG/A/CycleStart 0 2017-10-23 15:37:55.670 1650
STG/A/CycleStart 0 2017-10-23 15:37:55.193 1649
STG/A/CycleStart 0 2017-10-23 15:37:54.687 1648
The Timestamp column's default value is set to: (getutcdate())
I need to add the TIMESTAMP column for the last 24 hours where TOPIC = 'STG/A/CycleStart' and PAYLOAD = 1
I also need this time in seconds.
Any help would be greatly appreciated.
Thanks,
Mike
Topic -- nvarchar
Payload -- numeric
Timestamp -- datetime
id -- int
Here is some example data:
Topic Payload Timestamp id
STG/A/CycleStart 0 2017-10-23 15:37:56.697 1651
STG/A/CycleStart 0 2017-10-23 15:37:55.670 1650
STG/A/CycleStart 0 2017-10-23 15:37:55.193 1649
STG/A/CycleStart 0 2017-10-23 15:37:54.687 1648
The Timestamp column's default value is set to: (getutcdate())
I need to add the TIMESTAMP column for the last 24 hours where TOPIC = 'STG/A/CycleStart' and PAYLOAD = 1
I also need this time in seconds.
Any help would be greatly appreciated.
Thanks,
Mike