Okay, I answered my own question and used this:
<cfquery datasource="#datasource#" name="WebPollResults">
SELECT count(#QuestionName#) as totalper,#QuestionName# as Answer
FROM tblwebpolls
WHERE #QuestionName# IS NOT NULL
AND #QuestionName# <> ''
GROUP BY #QuestionName#
ORDER BY #QuestionName# ASC
</cfquery>
Brook
At 05:35 PM 12/13/2002 -0800, you wrote:
>I trying to write some SQL that will efficiently return information to
>create a web poll results graph. The database has 1 field, "pollresponse",
>which will contain 1 of 3 possible answers. I have these answers, and can
>use them in the query if necessary.
>
>How can I query this table and find out 1) the total number of submission
>where the field is not empty, 2) the number of votes for any of the 3
>possible responses.
>
>Is there some way I can do this with one query? If there is, I can't find
>it... Thanks for the assist!
>
>Brook
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm