Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MySQL (http://www.go4expert.com/forums/mysql-forum/)
-   -   MySQL: Grouping date by quarterly and half yearly (http://www.go4expert.com/forums/mysql-date-quarterly-half-yearly-t26736/)

cancer10 19Sep2011 22:31

MySQL: Grouping date by quarterly and half yearly
 
Hello

I am looking for some mysql query assistance from you experts :)


I have a table that stores all the download logs of software on my website.

The table structure is as below:

Code:

CREATE TABLE `software_downloads` (
  `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `software_id` INT(10) DEFAULT NULL,
  `download_date` DATETIME DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MYISAM DEFAULT CHARSET=latin1

So what I am looking for is, when I generate reports, my customers should be able to group the dates by quarterly and half yearly. That means, if they choose the quarterly option, the report should list all the count of software download logs and group them by three months and six months in case if they choose the half-yearly option.


Thanks in advance for your help.


All times are GMT +5.5. The time now is 19:26.