Query of Query would be the best way imho.

Eg.

<cfquery dbtype="query" name="uniqueid">
Select PropertyID from PropertyQuery <!--- This is the name of your
CFQuery --->
Group by PropertyID
</cfquery>

Total number of properties is:
<cfoutput>#uniqueid.recordcount#</cfoutput>


-----Original Message-----
From: Jeff [mailto:[EMAIL PROTECTED] 
Sent: 16 June 2003 13:27
To: CF-Talk
Subject: Array or Struct...which would be more 'do-able' for something
like this...


I'm doing a fairly complex join, and the recordcount of that join is a
different number than I actually need because I group the output. For
instance, I might have a recordcount of 13, but since the output is
grouped around, say, PropertyID, what you really see, are 2 properties.
One with 7 rates, and one with 8 rates, from the join.

This means that my query returns 8 PropertyIDs from one property, and 7
PropertyIDs from another property. What I'd like to do, is somehow come
up with the count of unique propertyIDs from the query results. I
thought, rather than run another query to get count and have two
queries, I'd rather try to use the existing query and determine the
count of unique PropertyIDs from the single, correct query.

I had an idea to loop over that query, populating some sort of data
structure but possibly checking for the existence of that PropertyID
before inserting it, ending up with a list or a struct with only unique
propertyIDs in them. Then, simply get the length or number of items in
the array or struct.

Am I approaching it the right way? Would it be easier (and by easier, I
mean, least amount of code overhead as possible) to use a struct, or an
array to do this?


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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

Get the mailserver that powers this list at 
http://www.coolfusion.com

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

Reply via email to