when you say “i retrieve a date” what does that mean?
are you retrieving it in an application language like php? and are you sure there is only one row that will be returned? and are you happy to do your process using two separate queries?
if so, you have multiple date functions in php which will allow you to extract dates
when you generate the conditions for the query that you want to run, make sure you generate a date that is equal to the first day of the month of the retrieved date, and a second date that is equal to the first day of the following month
for example,
WHERE somedate >= '2011-04-01'
AND somedate < '2011-05-01'
notice it’s “greater than or equal to” the first date, but it’s “less than” the second date
that way, you won’t ever have to worry about february 29th
FYI it does ~not~ look like that in the table, that’s just the default presentation format (mysql’s internal date format is not readable by humans)
so are you happy running two queries, one to get the date from one table and a second query for the other table, or would you rather not do it in one query?