1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQL: Grouping date by quarterly and half yearly

Discussion in 'MySQL' started by cancer10, Sep 19, 2011.

  1. cancer10

    cancer10 New Member

    Joined:
    Jul 12, 2008
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Webmaster
    Location:
    India
    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.
     

Share This Page