Hi Tony,

I'm using Access 2000 and I'll give this a try after I've had my morning
coffee (Pepsi)

Happy Holiday!

Ann Harrell

> -----Original Message-----
> From: Tony Gruen [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 26, 2001 12:27 AM
> To: CF-Talk
> Subject: RE: SQL Brain F@rt
>
>
> Ann,
> I am hardly the sharpest mind on this forum but I got this
> working using my
> dev SQL Server 7 database. I created a table named 'data' and
> added a field
> named 'state'. I entered some records and the code below returned
> a results
> page that read like "CA - 5, MA - 3, PA - 1".
>
>
> ....Here is the query....
> <cfquery name="qGetTotals" datasource="test">
> SELECT state, COUNT (state) AS StateCount
> FROM data
> GROUP BY state
> </cfquery>
>
> .... and here is the output......
> <cfloop query="qGetTotals">
> <cfoutput>#qGetTotals.state# - #qGetTotals.statecount#<br></cfoutput>
> </cfloop>
>
> Hopefully this solves your question.
>
> :-)
> Tony Gruen
> sfnetworks
>
>
>
>
>
>
> -----Original Message-----
> From: Ann Harrell [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 25, 2001 9:24 PM
> To: CF-Talk
> Subject: SQL Brain F@rt
>
>
> I have a STATE column in a database. There are duplicate states. I want to
> count the states 7 MA, 3 FL, 3 IN, ect) and eventually output them to a
> CFGRAPH pie chart.
>
> SELECT State
> From databasename
>
> is as far as I've gotten.
>
> Nightie.
>
> Ann Harrell
> Mind like a steel trap..
> Rusty and illegal in 37 states.
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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