My understanding is that you cannot use GROUP BY in your SQL. This goes 
into the CFOUTPUT tag.

Have you tried
<CFQUERY NAME="name" DATASOURCE="dsn">
         SELECT DateJoined, Year(Month(DateJoined)) as MonthCount,
                          Count(Year(Month(DateJoined))) as MonthJoinedCount
         FROM      Admin
         ORDER BY  Month(DateJoined), DateJoined, 
Count(Month(Year(DateJoined))) DESC
</CFQUERY>

<CFOUTPUT QUERY="dsn" GROUP=Month(DateJoined)>
         #Month(DateJoined)# #Count(Month(Year(DateJoined)))#
</CFOUTPUT>

HTH,

Judith

Owens, Howard put into words:


>I've been trying to get this group by month query to produced the desired
>results.  So far it's not working.
>
>In my database, I have a field called "DateJoined"  This is the actually
>date somebody joined, i.e. 1/24/01, 1/22/01, 1/5/01.  In other words, it's
>by the day.  Now I want to get a report on how many people joined in Jan.
>2001, as well as June 1999, etc.
>
>Here's the latest iteration of my query:
>
>
><cfquery name="MonthJoined"
>          datasource="#application.DSN#">
>SELECT DateJoined, Year(Month(DateJoined)) as MonthCount,
>Count(Year(Month(DateJoined))) as MonthJoinedCount
>FROM Admin
>GROUP BY Month(DateJoined), DateJoined
>ORDER BY Count(Month(Year(DateJoined))) DESC
></cfquery>

Judith Taylor
ICQ: 67460562
Freelance ColdFusion Developer - Athens, OH

Friends don't let friends code before coffee.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to