Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.sqlserver.server > #18818
| Newsgroups | microsoft.public.sqlserver.server |
|---|---|
| Date | 2017-11-14 10:04 -0800 |
| References | <d2ab174f-0825-43a1-82a4-1e715ef716dc@googlegroups.com> |
| Message-ID | <085cb6a3-4913-424c-ab0d-fe89e54c0b9d@googlegroups.com> (permalink) |
| Subject | Re: SQL Query help |
| From | toddism@gmail.com |
On Monday, October 23, 2017 at 3:07:39 PM UTC-4, Mike Arney wrote: > 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 so you need the time elapsed since the timestamp in seconds?
Back to microsoft.public.sqlserver.server | Previous | Next — Previous in thread | Find similar
SQL Query help Mike Arney <mikespcnet.net@gmail.com> - 2017-10-23 12:07 -0700 Re: SQL Query help toddism@gmail.com - 2017-11-14 10:04 -0800
csiph-web