View Single Post

  #5 (permalink)  
Old 27-02-2008, 12:23 AM
ziycon's Avatar
ziycon ziycon is offline
Wannabe Geek
 
Join Date: Jan 2007
Location: Dublin
Posts: 406
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
ziycon will become famous soon enough
Send a message via MSN to ziycon Send a message via Skype™ to ziycon
Default

Quote:
Originally Posted by Frodo View Post
I would have done it like this but its the same thing really. I tested this code and it works (I use it), I haven't used those functions (year() and monthname() ) in MySQL before Briask are they commonly used?


Code:
SELECT DATE_FORMAT( `event-date` , '%M %Y' ) , COUNT( * )
FROM `events` WHERE `userid` = '1'
GROUP BY DATE_FORMAT( `event-date` , '%M %Y' )
ORDER BY DATE_FORMAT( `event-date` , '%M %Y' );
On a side note working these kind of things out is the best way to learn mysql I hope you had a go at it before asking here.
I have had a go but i can't figure out how to take the dates from the record and the work with them, there all in the YYYY-MM-DD format.
Reply With Quote