Query that returns data that is staggered

I have a database that has 50,000 records from a remote field device. These readings are every 16 seconds, and are stored as such in the database. What I am wondering is if there is a query that I can do that will return the reading at every hour? I am currently running the query with the device ID, and getting all readings. The column for date and time is the datetime format.

Thanks,

Brad
bradbrittonAsked:
Who is Participating?
 
Aneesh RetnakaranDatabase AdministratorCommented:
reading during last hour

Select
WHERE DATEDIFF(hh,urDateTimeColumn,GETDATE()) = 1
0
 
SireesCommented:
You can create a job with your query and schedule it to run every one hour.
0
 
HuyBDCommented:
Try to use "WAITFOR DELAY"

e.g.

while 1<>2
begin
 WAITFOR DELAY '00:01:00'
 --quey here
end
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.