Re: Select where date = curdate() and 2 days ago?
| From: | Becoming Digital | Date: | Mon, 05 May 2003 18:19:02 +0000 |
| Subject: | Re: Select where date = curdate() and 2 days ago? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-27542@lists.php.net to get a copy of this message | ||
I'm beginning to believe that John knows too much SQL for his own good! ;)
Edward Dudlik
Becoming Digital
www.becomingdigital.com
----- Original Message -----
From: "John W. Holmes" <holmes072000@charter.net>
To: "'Lewis Watson'" <php@visionsix.com>; <php-db@lists.php.net>
Sent: Thursday, 01 May, 2003 17:05
Subject: RE: [PHP-DB] Select where date = curdate() and 2 days ago?
> > > I have a table where one of the columns has a date time field. I
am
> > rtying
> > > to build a query that will pull all results between the current
date
> > and
> > > up to 48 hours (2 days) ago. I have tried various queries using
> > examples
> > > like below...
> >
> > SELECT * FROM calls WHERE event_date_time BETWEEN NOW() - INTERVAL 2
DAY
> > AND NOW()
> >
> > ---John W. Holmes...
>
> Thanks!! I was getting so tired of staring at the same problem for 2
hours
> :-)
> Lewis
DELETE FROM problems WHERE problem BETWEEN NOW() - INTERVAL 2 HOUR AND
NOW()
;)
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php