Get all records from Last Two Days?
- From: "John" <nothanks@xxxxxxxx>
- Date: Tue, 18 Apr 2006 18:27:18 -0400
Hi Everyone,
I use the following to get records from the last two days in MySql:
where date_entered <= curdate() and date_entered >=
DATE_SUB(curdate(),INTERVAL 2 day)
I'm looking to do the same in MS-Sql server but I'm just not getting it.
I've got this so far which does not work:
where hit_date <= GETDATE() and hit_date >= DATE_SUB(GETDATE(),INTERVAL 2
day)
then I tried this:
WHERE hit_date >= DATEDIFF(GETDATE(), (GETDATE()-2)>
Essentially, I need all records from the last two days.
Any help or guidance in this matter would be greatly appreciated.
-JohnyB
.
- Follow-Ups:
- Re: Get all records from Last Two Days?
- From: Erland Sommarskog
- Re: Get all records from Last Two Days?
- From: Jens
- Re: Get all records from Last Two Days?
- From: Tom Moreau
- Re: Get all records from Last Two Days?
- Prev by Date: Re: delete sql syntax for linked notes table
- Next by Date: Re: Get all records from Last Two Days?
- Previous by thread: FS: 7 for $30 CHEAP Books - SQL Programming Database Management
- Next by thread: Re: Get all records from Last Two Days?
- Index(es):
Relevant Pages
|