Web Hosting - Debt Consolidation - Wordpress Themes - Business Gifts - Wordpress Themes

PDA

View Full Version : Grouping results by month


tariqali
Oct 17th 2006, 7:27 am
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!

websiteideas
Oct 17th 2006, 3:50 pm
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>