Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Web Report from Access

Posted on 1999-07-14
10
Medium Priority
?
158 Views
Last Modified: 2013-12-25
I have an online Survey that has around 20 questions and each question has 4-5 radio buttons. I need to write a report that will count the number of responses per each radio button. Any help or advice would be very helpful. Thanks-
0
Comment
Question by:yolish
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
  • +1
10 Comments
 
LVL 10

Expert Comment

by:MasseyM
ID: 1864073
Simple.  Use a database that will add one to the appropraite column...

If you have the survey in html form, send it to me at masseym@javanet.com (with the database if you have that too).  I am going to assume ASP is being used with access...
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 1864074
Doesn't this sound like a Record.Count issue... ;-)

That is assuming of course the radio button 'true'  is actually recorded to a field.

Mark
0
 

Author Comment

by:yolish
ID: 1864075
If you use Record.Count I would have to use about 100 select statements for every option. Thanks
0
Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

 
LVL 18

Expert Comment

by:mgfranz
ID: 1864076
How are you tracking the -1 of the radio button?  If it is fact being written to the dB as a true/false, then yes, you would need to do some script writting, I don't think a 100 select statements would be needed, just loop through the fields, do a Record.Count and write the results to a seperate table.  This would require a naming convention like radio1, radio2, radio3, ...  Then you could loop via;

For Each radio() {
Record.Count...
update dB
}
0
 
LVL 11

Accepted Solution

by:
mouatts earned 200 total points
ID: 1864077
Nope just one select statement and one loop will do it.

sql="SELECT question_num,COUNT(button1) AS t1,COUNT(button2) AS t2,COUNT(button3) AS t3,COUNT(button4) AS t4,COUNT(button5) AS T5
FROM MY TABLE
GROUP BY question_num;"
set res=connection.execute(sql)
while NOT res.EOF%>
    Question <%=res("question_num")%>&nbsp;<%=res("t1")%> &nbsp;<%=res("t2")%>
&nbsp;<%=res("t3")%>
&nbsp;<%=res("t4")%>
&nbsp;<%=res("t5")%>
<BR>
<%  res.movenext
WEND

0
 

Author Comment

by:yolish
ID: 1864078
So with this, I would have to name every radio button 'button1' button2', etc.

What is with quest_num?
0
 
LVL 11

Expert Comment

by:mouatts
ID: 1864079
Ok I had assumed that each option on each question was store in its own column and that question_num was the number of the question (or it could be the question its self)

If on the other hand you are storing just the response to the question in a single field (eg answer 1 stores 1, 2 2 and so on then the SQL will need to change a bit).

Can you post your table structure and I''l confirm the SQL.

Steve
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 1864080
Yes, each button would be named button1, button2, button3... cause the value of the question_name, or quest_num is the where clause.  The only problem I see with mouatts reply, is that this just returns the values of the buttons fields, not the count of a true value...

Mark
0
 

Author Comment

by:yolish
ID: 1864081
Here it is

UserID
rbSFA
rbEnterprise
rbCustomer
rbBranding
rbCatalogue
rbService
rbDevelopment

And so on

0
 
LVL 11

Expert Comment

by:mouatts
ID: 1864082
I'm still not too sure of the structure but if each of the rb fields represents the question and the contents of the field represents the answer then the problem is a bit more complex. In that you will need to to the totaling manually and not within the SQL.

eg
the SQL would be
SELECT rbSFA,rbEnterprise,... FROM mytable

and the loop would be something like

SELECT CASE res("rbSFA")
      CASE 1
          sfa_tot1:=sfa_tot1+1
      CASE 2
          sfa_tot2:=sfa_tot2+1

and so on for each question.

If you are going to be doing a lot of number crunching on this you may be better to change your structure so that the response to each question is stored in a seperate record.

HYTH
Steve
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question