Re: Date Select
| From: | Gerben | Date: | Fri, 25 Jun 2004 17:09:28 +0000 |
| Subject: | Re: Date Select | ||
| References: | 1 | Groups: | php.db php.general |
| Request: | Send a blank email to php-db+get-34963@lists.php.net to get a copy of this message | ||
select * from table where TO_DAYS(date_field) > ( TO_DAYS(NOW()) -7 )
this will give the entries of the last 7 days (and the ones that are in the
future)
"Tom Chubb" <tom@ps-promo.co.uk> wrote in message
news:JPEMIHJHEEGAJDFPLGHIKELOEMAA.tom@ps-promo.co.uk...
> How can I query a MySQL table to get the latest results from a date field?
> Basically, I am inserting several records at a time at the end of each
week.
> I want to have a page that displays the results for the last week only.
> The date format in the field is YYYY-MM-DD
>