Page 1 of 1
finding a date with month year
Posted: Tue Mar 13, 2007 1:41 pm
by dstefani
I want to get a set of records all from the same month and I only have the month and year to give to MySQL and the date in the table is in the standard MySQL format (yyyy-mm-dd) ?
Thanks,
- dstefani
Re: finding a date with month year
Posted: Tue Mar 13, 2007 3:31 pm
by volka
dstefani wrote:and the date in the table is in the standard MySQL format (yyyy-mm-dd) ?
Does that mean the type of the file is DATE or DATETIME?
Posted: Tue Mar 13, 2007 3:35 pm
by dstefani
DATE
Thanks
Posted: Tue Mar 13, 2007 3:41 pm
by volka
if you have e.g. month=3 and year=2007 you can create a query like
Code: Select all
WHERE datefield > '2007-03-01' and datefield < '2007-04-01'