Re: between date
| From: | Torsten Roehr | Date: | Tue, 18 May 2004 17:47:42 +0000 |
| Subject: | Re: between date | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-186496@lists.php.net to get a copy of this message | ||
>"Jay Blanchard" <jay.blanchard@niicommunications.com> wrote in message
ews:C8F323573C030A448F3E5A2B6FE2070B03522555@nemesis...
>[snip]
>I have a table whereby I use the php date() and time() function.
>
>I retrieve the data etc, no problem.
>
>but I now need to perform a query of between dates.
>
>Is there a function or method to perform this.
>[/snip]
>
>Use SQL 'BETWEEN' i.e.
>
>SELECT items FROM table WHERE date BETWEEN this date AND that date
>
>It is inclusive
I think working with >= and <= works as well and may be more portable:
SELECT items FROM table WHERE date >= start AND date <= end
Regards, Torsten