Get all records from Last Two Days?



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


.



Relevant Pages

  • Re: Get all records from Last Two Days?
    ... SQL Server MVP ... I use the following to get records from the last two days in MySql: ... Any help or guidance in this matter would be greatly appreciated. ...
    (comp.databases.ms-sqlserver)
  • Re: Get all records from Last Two Days?
    ... SQL Server MVP ... I use the following to get records from the last two days in MySql: ... Any help or guidance in this matter would be greatly appreciated. ...
    (comp.databases.ms-sqlserver)
  • Re: PhpMyAdmin multi user install troubles, help needed...
    ... > know matter how much I read and look around, ... > permission checks and a few changes, restarting the server, deleting ... > I used the create_tables.sql in the scripts folder chose to use cookie ... > permissions on the mysql db, made certain that the config.inc.php file ...
    (comp.lang.php)
  • Re: 32 or 64 bit as server ?
    ... getting a FreeBSD 8.1 server. ... I want to run MySQL 5.x, PHP5, ... whether it would matter if I choose 32 of 64 bit? ...
    (freebsd-questions)
  • Re: using access with mysql - common error
    ... I since left MySql since every office cd now has a free edition of sql ... incredible ms-sql server Enterprise tools for free, ... sql server engine. ... ms-sql server tools and database for free. ...
    (microsoft.public.access.formscoding)