Querry for selected time in time series data

J

JBrady

I have a several large database tables that has a records collected every 5
minutes for a one year period. I need to see only the records collected at
midnight of each day for the last year for all of teh tables I have. All of
the data in all tables are time synchronized. How do I design a querry for
this?
 
R

raskew via AccessMonster.com

Check this site to see how Access stores date/time
http://support.microsoft.com/kb/q130514/

so ...
x = #8/8/2008 12:00:01 AM#
? cdbl(x)
39668.0000115741

however, if the time is exactly midnite:
y = #8/8/2008 12:00:00 AM#
? cdbl(y)
39668
so ...

int(cdbl([YourField])) = cdbl([YourField])

as the criteria for your date field should
return just those records recorded at exactly midnite.

This is aircode since I don't have anything to test it against,
but think it should work.

HTH - Bob
 
R

raskew via AccessMonster.com

In relooking your post, see you need it for the last year. Assuming you
those
records from the previous calendar year (2007), try:

between dateserial(year(date)-1, 1,1) and dateserial(year(date),1,0) will
provide just those dates from the previous year.

Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top