Re: Date question
| From: | Chris | Date: | Mon, 13 Mar 2006 04:12:24 +0000 |
| Subject: | Re: Date question | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-41470@lists.php.net to get a copy of this message | ||
Gerry Danen wrote:
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.Which database are you using? Mysql has this: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html Postgresql has: http://www.postgresql.org/docs/8.1/static/functions-datetime.html I'm sure others have the same sort of functionality. -- Postgresql & php tutorials http://www.designmagick.com/