I keep finding complex solutions to “similar” questions, but what I’m needing I think is much more simple.
I have a table that has “Winners” in it. Name, address, etc… and most important, the date that they won. I then want to display this on the website.
SELECT FirstName, LastName, Prize, Winning_Date FROM Prize_Table
ORDER BY Winning_Date DESC
Now the Winning_Date column is data type date.
So here’s my question.
If the date is 2012-01-01, I want to be able to display just the month, and the year… in regular text.
e.g.:
January, 2012
It would also be nice to be able to place just the month abbreviated (Jan) and the year, in two different places within span tags. Kinda like you see those little calendar icons with the month, and year… and/or date, etc.
JAN
2012
I want to make sure that I preserve the ability to order by date as well… month, year is fine.
Thank you for your help.
You can do it like this: