Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 query help all records in the last hour

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2008-06-26 : 14:00:21
I want to query out all records in the last hour

i'm doing

SELECT * from images where datetime>DATEADD(hh, -1, datetime) order by id

what am i doing wrong - it's returning more then the last hour

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-06-26 : 14:03:01
SELECT * from images where datetime>DATEADD(hh, -1, Getdate()) order by id

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2008-06-26 : 14:23:51
thanks..silly mistake
Go to Top of Page
   

- Advertisement -