473,473 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

find rows within seconds of top of hour

I have rows of data that have a datetime stamp. I need to find rows
that have a datetime stamp within 10 seconds of the top of each hour.
I started with datediff(s,getdate(),LeadDate) but I am stumped on how
to process for each hour.
I.E. records between 9:00:00 and 9:00:10 , 10:00:00 10:00:10, and so
forth for each hour.
Ideas?

Oct 24 '07 #1
1 1835
On Wed, 24 Oct 2007 06:06:53 -0700, rcamarda
<ro**************@gmail.comwrote:
>I have rows of data that have a datetime stamp. I need to find rows
that have a datetime stamp within 10 seconds of the top of each hour.
I started with datediff(s,getdate(),LeadDate) but I am stumped on how
to process for each hour.
I.E. records between 9:00:00 and 9:00:10 , 10:00:00 10:00:10, and so
forth for each hour.
Ideas?
To select just the rows from those intervals:

SELECT *
FROM Whatever
WHERE DATEPART(minute,LeadDate) = 0
AND DATEPART(second,LeadDate) BETWEEN 0 AND 10

Roy Harvey
Beacon Falls, CT
Oct 24 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Fabio | last post by:
Hello, is there any quite easy solution for the problem of transposing the rows into the columns? I have the following table with some data in it: dealer date 09.00 10.00 11.00 ...
3
by: fred14214 | last post by:
I need to be able to enter an elapsed time into a text field. This time then needs to be converted into seconds and stored in a field in some table. The user will enter a time (format is...
6
by: Sameer | last post by:
Hi, I have a table which is something like this : Date Hour Minute Name Cost 12/12/01 2 4 ABC 15 12/12/01 2 15 ABC 7 12/12/01 2 55 ABC 8...
6
by: j0mbolar | last post by:
i've read recently that time_t doesn't have to be in second resolution but if it isn't, then what resolution could it be in? microseconds, milliseconds, are all valid? also, does anyone know...
2
by: Chris Leffer | last post by:
Hi. My application reads a table that stores data as time, eg: 02:17:31 I need to read this value and convert it to an integer, representing the total number of seconds. At this moment I am...
3
by: taru | last post by:
Env: DB2 UDB 8.1 on AIX We are executing a db2 sql stored procedure which is invoked from a java client. The stored procedure contains few select, insert and update statements. Using the DB2...
4
by: PinkBishop | last post by:
Hello, I have a simple calendar scipt that ask for time of event input. While I like the time feature I do not like the fact that it displays with seconds included. Ex. Displays HR:MIN:SEC...
13
by: Mark | last post by:
Dear folks, In Javascript, is it possible to get all id names within, say, a <div></divpair? Like the array of "document.images", I mean. The reason I ask, is that I have a calender whose...
0
by: geraldjr30 | last post by:
hi, i have the following: <html> <STYLE type="text/css"> TD{font-family:ARIAL;font-size:11px;color:#666666;}
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.