Re: Date question
| From: | Gerry Danen | Date: | Fri, 17 Mar 2006 18:32:39 +0000 |
| Subject: | Re: Date question | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-41545@lists.php.net to get a copy of this message | ||
This works perfect, Bastien!
Many thanks.
Gerry
On 3/13/06, Bastien Koert <bastien_k@hotmail.com> wrote:
>
> select * from table where date_format(date_field, '%Y-%m') = '2006-02'
>
>
> bastien
>
>
> >From: "Gerry Danen" <gdanen@gmail.com>
> >To: php-db@lists.php.net
> >CC: php_and_mysql@yahoogroups.com
> >Subject: [PHP-DB] Date question
> >Date: Sun, 12 Mar 2006 20:44:13 -0700
> >
> >While I am rebuilding my crashed laptop (the machine that had all my
> >intelligence), I started thinking about a select statement I need.
> >
> >I have log info in a table and want to extract it on a monthly basis. The
> >date field is in yyyy-mm-dd format. What's a good way to select those
> dates
> >that match 2006-02, for example.
> >
> >I apologize if the solution should be staring me in the face, but all my
> >favorites and help files are toast, until I can restore some of them.
>