in your query only select only female governess
then use the cfoutput group attribute to group by year, this will then only
output records for the same year.
you need to next 2 cfoutput.
<cfoutput query="myquery">
<cfoutput group="year">
your output here
</cfoutput>
</cfoutput>
On Sat, Sep 25, 2010 at 12:23 AM, GLM <[email protected]> wrote:
>
> I have a database with presidents, governors, etc. and need to be able to
> pull out information such as:
>
>
>
> Get the number of all female governors over the years and spit out
> something
> on the order of:
>
>
>
> 1789 : 0
>
> 1790 : 0
>
> .
>
> 2005 : 10
>
> .
>
> 2010 : 6
>
>
>
> The database has dateStarted, dateEnded
>
>
>
> I can loop through this [SIMPLIFIED CODE]
>
>
>
> <cfloop>
>
> <cfquery>
>
> SELECT
>
> FROM
>
> WHERE year == #desiredYear#
>
>
>
> </cfquery>
>
> </cfloop>
>
>
>
> This seems like a foolish way to do this. Is there a better way to do it?
> Is
> it better to make one query and then use CF to parse it
>
>
>
>
>
>
>
>
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337526
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm