Re: how can I do?
| From: | 1LT John W. Holmes | Date: | Thu, 19 Sep 2002 19:03:05 +0000 |
| Subject: | Re: how can I do? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-21855@lists.php.net to get a copy of this message | ||
> I am trying to find the records whose create dates (field name
> =create_date) are between the ones I want .For example , I want to seee
the
> records between $start_date and $end_date ..So I tried the code
> below..But it looks not that right to me?...
>
> select * from bug where ...... and "$start_date < create_date< $end
> _date
You want:
WHERE $start_date < create_date AND $end_date > create_date
or...
WHERE create_date BETWEEN $start_date AND $end_date
but, this is dependant on your format of create_date and the variables
$start_date and $end_date. All of them should be MySQL DATE, DATETIME, or
TIMESTAMP columns/format.
---John Holmes...