2

I have an MS Access database table that populates every minute, and I need to write a query to select the data at the start of every hour. Does anyone how I would go about writing such a query?

BOF_TOTAL   EAF_TOTAL   EAF BOF     TO_CHAR(DATETIME,'MM/DD/YYYYHH24:MI:SS')
.
.
.
.
315499  38756   5.6 12      7/1/2011 16:00
315511  38762   5.6 12      7/1/2011 16:01
315523  38771   5.6 12      7/1/2011 16:02
315535  38779   8.4 12      7/1/2011 16:03
315547  38787   8.4 12      7/1/2011 16:04
315559  38787   8.4 12      7/1/2011 16:05
315571  38797   8.4 12      7/1/2011 16:06
315583  38805   8.4 12      7/1/2011 16:07
. 
. 
. 
316219  39596   6.7  12     7/1/2011 17:00
. 
. 
. 
316939  40436   6.9  12     7/1/2011 18:00

I would like a query that will that grab only the data at 16:00, 17:00, 18:00, etc.

So the output of the query is:

315499  38756  5.6  12      7/1/2011 16:00
316219  39596  6.7  12      7/1/2011 17:00
316939  40436  6.9  12      7/1/2011 18:00

I hope that this helps to better clarify my question.

LaDante Riley
  • 521
  • 4
  • 14
  • 26

1 Answers1

0

Getting the date from the elapsed hour ?

WHERE MyTime between int(Now())-1/24 And int(Now())

should do it. Change Now() into Now if you're in VBA.

iDevlop
  • 24,841
  • 11
  • 90
  • 149
  • I am not looking for data from the last elasped hour but from the start of the hour as in data @ 00:00, 1:00, 2:00, 3:00, 4:00, 5:00, 6:00,7:00, 8:00, 9:00, 10:00, 11:00, 12:00, 13:00, 14:00, 15:00, 16:00, 17:00, 18:00, 19:00, 20:00, 21:00, 22:00, 23:00, 24:00 – LaDante Riley Jul 27 '11 at 20:18
  • Great. But you have a brain and enough information now, don't you ? – iDevlop Jul 27 '11 at 20:36