Grouping results by month

Discussion in 'Programming' started by tariqali, Oct 17, 2006.

  1. #1
    Hello,

    I have a query that pulls results from the database and group them by week. I have a weekstart date and weekending date in the results table. This report will have Year to date results and I wanted to break the results to display by Month. How can I achive this?

    Thanks for the help!
     
    tariqali, Oct 17, 2006 IP
  2. websiteideas

    websiteideas Well-Known Member

    Messages:
    1,406
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    130
    #2
    What does the following output?

    <cfquery name="rsShowDate" datasource="dbname"> SELECT TheDate FROM tblname GROUP BY TheDate ORDER BY TheDate ASC </cfquery>

    <cfoutput query="rsShowDate" group="TheDate">
    #rsShowDate.TheDate#
    #LSDateFormat(rsShowDate.TheDate,'MMMM YYYY')#
    </cfoutput>
     
    websiteideas, Oct 17, 2006 IP