Re: Retrieve the month from a date field
| From: | Nenad Djordjevic | Date: | Wed, 09 Apr 2003 11:57:08 +0000 |
| Subject: | Re: Retrieve the month from a date field | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-26952@lists.php.net to get a copy of this message | ||
Hello Shaun,
I suppose that type of date filed is
DATE or DATETIME.
This is sample SQL code for MySQL:
SELECT * FROM TableName WHERE (MONTH(DateField) = 4)
________________________
Best regards,
Nenad Djordjevic mailto:nenad@diyomisoft.com
Diyomi Soft
http://www.diyomisoft.com/
Wednesday, April 9, 2003, 1:20:21 PM, you wrote:
s> Hi,
s> I have a date field in my table (YYYY-MM-DD). Is it possible to retrieve all
s> the rows that occur in a given month i.e. April?
s> Thanks for your help