Or, alternately - if you have 10 answers to collect, give each a
number/letter value

Q1. 1A, 1B, 1C, etc.
Q2. 2A, 2B, 2c, etc.

Then just insert them as usual

<query>
INSERT INTO tablename (col_Q1, col_Q2, col_Q3, etc.)
VALUES (#form.Q1#, #form.Q2#, etc)
</query>

Then you can read the table and know how many users voted for each
question....

J

-----Original Message-----
From: James Maltby [mailto:[EMAIL PROTECTED]] 
Sent: Monday, April 15, 2002 14:17
To: CF-Talk
Subject: RE: survey trouble


What about giving each a letter value = e.g.

Strong A = A
Agree = B
Neutral = C
Etc.

Then on "landing" page converting the "val" via a "switch" statement into a
value and inserting it into the database.

<cfquery datasource="" name="">
UPDATE table  
<cfswitch expression="#form.val#">
<cfcase value="A">
SET Valcolumn_A = Valcolumn_A + 1
</cfcase>
<cfcase value="B">
SET Valcolumn_B = Valcolumn_B + 1
</cfcase>
<cfcase value="C">
SET Valcolumn_C = Valcolumn_C + 1
</cfcase>
Etc.
</cfswitch>
</cfquery>

I think this should work, but it may be worth a try - mainly due to
<cfswtich> being a little flaky inside <cfquery>

J

-----Original Message-----
From: Craig Thomas [mailto:[EMAIL PROTECTED]] 
Sent: Monday, April 15, 2002 14:04
To: CF-Talk
Subject: survey trouble


I am having trouble creating a 'simple' survey with answers like the
following:

'Strongly Agree'
'Agree'
'Neutral'
'Disagree'
'Strongly Disagree'

I cannot conceptualize how to store and make sense of the answers without a
huge amount of code.  We do not care to record individual answers (but
will/can), but want to know how many people agree/disagree with each
question.  (There are 10 questions.)  All the questions have the same
possible answers.

Any help is greatly appreciated,

Craig Thomas
www.worldcupbicycles.com



______________________________________________________________________
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
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to