Working with time

  • Thread starter Christian Davidsson
  • Start date
C

Christian Davidsson

Hi!

I've got a query collecting data from another database, each hour of the day
between 06.00 and 23.00. It picks up the data, adds two fields where it
enters Date() and Now() in each. Date for picking up the date of the import,
and Now() for the time. Everything is stored in a ever growing table.

Now comes my problem - I want to run a query against the table and collect
the data from a certain hour. The problem is that the work requiers the data
from a certain hour to be collected, however - the importing from the 1st
database can happen from anything to -15 to +15 minutes around the hour.

So I can have a record timestamped at 10.49 and when setting up the query, I
want this to show if I select that I want data from the 11'th hour. Same if
the import was done at 11.14.

It's acceptable to have it +/- 30 minutes if that's easier.

If anyone could help me out with this problem, I'd be a verry happy chap ;)


Thanks in advance,
Christian Davidsson
 
M

Michel Walsh

Hi,


Hour( DateAdd("n", 15, YourInitialDateTimeValue) )

would result in 11 for any initial time from 10:45 up to, exclusively, 11:45


WHERE Minute( DateAdd("n", 15, YourInitialDateTimeValue) ) <=30

would eliminate the records with a initial minute from 15 to 45



Hoping it may help,
Vanderghast, Access MVP
 

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