Current Time Plus 2 Hours

thegooser

Registered User.
Local time
Today, 06:04
Joined
Aug 16, 2010
Messages
15
Hi all,

I have a query with a date field and a separate time field. I want ti to show results for the next two hours. The date field criteria is set to Date() which returns the results for today, but could anyone tell me what I need for the time field to return all the results within the next two hours?

Thanks if anyone can help.
 
Are you looking for something like so:
time() + #02:00:00#

??

Many ways to skin a cat though
 
or perhaps:

DateAdd("n",120,Time())

JR
 
Hi

In my query I have the following to calculate plus 2 hours from the current deletiion time:

Time Deletion: Right([dtmDeletionTime],8)

The above gets only the right 8 characters, which are the time part of the Date() function.

Plus 2 Hours: Format([dtmDeletionTime]+#02:00:00#, "hh:nn:ss")

The above adds to hours to whatever time is in the dtmDeletionTime field.

I show the original deletion time in the Time Deletion Field in my query and the desired deletion time in my Plus 2 hours field in my query.


I hope this helps

John
 
Time Deletion: Right([dtmDeletionTime],8)
Though it works, this relies on an implicit conversion... which is bad.

Instead using Timevalue() to extract the time only would be much prefered and much less prown to errors
 

Users who are viewing this thread

Back
Top Bottom