Hi Les, You could use ListValueCountNoCase if there is some reason for
not letting the dbms do this aggregation for you.  On the whole the
database engine is better (i.e. faster) at this kind of data
manipulation than CF is.

What I would suggest is that your select gets the country and count of
distinct categories and then you put these in a structure where the
country_name is the key and the value is the count.  This will let you
access the relevant count directly without any looping over the query or
a long list.

heres how to construct the structure from a select that gives country
and a cat count (as per my previous reply).

<cfset stCtryCat = structNew()>
<cfloop query="qctrycat">
   <cfset stCtryCat[country] = catcount>
</cfloop> 

<cfoutput>#stCtryCat["DE"]#</cfoutput>

Hope that helps.

Michael Traher 
Systems Manager


-----Original Message-----
From: Les Mizzell [mailto:[EMAIL PROTECTED] 
Sent: 04 August 2003 20:35
To: CF-Talk
Subject: RE: What the heck is wrong with this Query?

::: <CFSET egypt_Count =
ListValueCountNoCase(ValueList(PA_CT.PA_COUNTRY),"egypt")>

:: De-dupe the list then count it


How you you do that, exactly?


I need to be able to use #InsertNameOfCountryHere_Count# anywhere on the
page as needed - for each of some 30 different countries....


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to