Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Output Help

Status
Not open for further replies.

BFreshour

Programmer
Mar 20, 2002
84
0
0
The query data is coming out like this on my final query:
----------------------
Code:
QUESTION     ANSWER   VOTES
Fav Color    Blue     1
Fav Color    Red      2
Fav Color    Green    2
Fav Food     Mexican  2
Fav Food     Italian  1
Fav Food     American 4
----------------------

I need an output query that will post the question (once not as many times as their are answers), the answers to that question, and how many votes each has answer has...

Is this possible or do I need to re-do my query. My query is based of 3 tables. You can view my table setup by going to the topic in the SQL forum called Poll Results... - I'll post a link, but since I'm logged in, I'm not sure if it will work for you:

thread183-255390
 
Add a GROUP BY to your query and add the columns you want to group to it.

Now you can use CFML's GROUP attribute:

<cfoutput query=&quot;GetQuestions&quot; GROUP=&quot;Question&quot;>
#Question#<br>
<cfoutput>
#Answer# #Total#
<cfoutput>
</cfoutput>

A peek at this may help:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top