I have this code:
DATESUB(CURDATE(), INTERVAL x MONTH)
where x is in a stored procedure. However instead of finding the date x month’s ago, i need to just find out which month it was, and label it as its correct english.
For example todays month is December. If x was 2, it would return 2012/10/02. Instead of this I just want October
You would want to use
DATE_FORMAT:If you were to use:
It would return
Octoberas the resultSee SQL Fiddle with Demo