|
-
May 1st, 2007, 04:05 AM
#1
Thread Starter
Addicted Member
[RESOLVED] How do I do this in SQL Server?
If I had a table in ACCESS with a date/time column and I wanted all records within the last 24 hours I could do this sort of thing:
SELECT * FROM Table1 where datediff('n',Field1,now) < 1440
How do I do this in SQL Server?
Thanks
Last edited by Hack; May 1st, 2007 at 06:11 AM.
Reason: Added RESOLVED to thread title and green resolved checkmark
Another light-hearted post from Guru 
-
May 1st, 2007, 04:33 AM
#2
Hyperactive Member
Re: How do I do this in SQL Server?
Give this a whirl!
Code:
SELECT * FROM Table1 where datediff(hour,Field1,GetDate()) <= 24
-
May 1st, 2007, 04:42 AM
#3
Thread Starter
Addicted Member
Re: How do I do this in SQL Server?
Another light-hearted post from Guru 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|