Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting Hour -1 1

Status
Not open for further replies.

scottyjohn

Technical User
Nov 5, 2001
523
GB
Hi all,
I am using the query below to query a back end oracle view from an access front end.

SELECT SOFTPHONE.*
FROM SOFTPHONE
WHERE STARTD=Format(Now(),'dd/mm/yyyy')
and left(startt,2)=Format(Now(),'HH');

It works fine for current date, current hour, but I need to adapt the query to select current hour -1, but cant seem to get the syntax right. Can anyone point me in the right direction?

John
[bigglasses]
 
Code:
and left(startt,2)=Format([red]DateDiff("h",-1,Now())[/red],'HH');
 
Sorry ... too early in the morning
Code:
and left(startt,2)=Format([red]DateAdd("h",-1,Now())[/red],'HH');
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top