RE: SQL Brain F@rt
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 > > SELECT state, COUNT (state) AS StateCount > FROM data > GROUP BY state > > > and here is the output.. > > #qGetTotals.state# - #qGetTotals.statecount# > > > 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/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
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 SELECT state, COUNT (state) AS StateCount FROM data GROUP BY state and here is the output.. #qGetTotals.state# - #qGetTotals.statecount# 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/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: SQL Brain F@rt
Ann, The answer to this question will be somewhat dependent on what database your using. What db are you hitting for the information? Sql Server, Access, Oracle? 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/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: SQL Brain F@rt
Try SELECT State, Count(State) AS StateTotal FROM databasename GROUP BY State; -Original Message- From: Ann Harrell [mailto:[EMAIL PROTECTED]] Sent: Friday, May 25, 2001 10: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/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists