troubleshooting Question

Grouping question

Avatar of Eric Bourland
Eric BourlandFlag for United States of America asked on
ColdFusion Language
3 Comments1 Solution189 ViewsLast Modified:
ColdFusion 9
MS SQL Server 2005

Hi. My CFOUTPUT does not group on column PublicationYear the way that I think it should. =) How can I edit my query or my output to get this result:

"CEP scheduled no meetings in year 2011."

rather than this result:

"CEP scheduled no meetings in year 20112011201120112011201120112011201120112011201120112011201120112011."

I am guessing I cannot group variable #url.selectedYear# on column PublicationYear because variable #url.selectedYear# is not referenced in query getDocumentYears.

Thanks as always for advice. I've been puzzling over this task for a while today.

Eric

Query, getDocumentYears:

<!--- query to select document publication years --->
<cfquery name="getDocumentYears" datasource="#application.datasource#">
SELECT DISTINCT Year(DocumentPublicationDate) AS PublicationYear
FROM tbl_CEP_Documents
ORDER BY PublicationYear DESC
</cfquery>

Output:

<p>CEP scheduled no meetings in year <cfoutput query="getDocumentYears" group="PublicationYear" groupcasesensitive="no">#url.selectedYear#</cfoutput>.</p>

Example: http://www.cep-dc.org/meetings/index.cfm?selectedYear=2011

Open in new window

ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros