Re: SELECTing a date range from a table
| From: | Jason Wong | Date: | Mon, 05 Aug 2002 04:50:50 +0000 |
| Subject: | Re: SELECTing a date range from a table | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-20989@lists.php.net to get a copy of this message | ||
On Monday 05 August 2002 10:04, Chase Knott wrote:
> I have used phpMyAdmin to change my "edate" and "cdate" columns to a DATE
> type. This has changed all of the data to a YYYY-MM-DD format which has
> messed up the dates in my database, but I can work with Excel to try to fix
> that. Now, all of the data in "edate" and "cdate" is similar to
> "2002-07-08."
Good.
> > The column names are "vendor," "edate," "cdate," and
> > "fname."
> > I want to pull all entries in the database where "cdate" is either
> > between a certain range, or is greater than or equal to a specified date.
For example to find all entries where cdate is later than 2002-08-01:
SELECT * FROM table WHERE cdate > '2002-08-01';
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Don't try to have the last word -- you might get it.
-- Lazarus Long
*/