Your task shouldn't be to handle values that were not returned from the
query. You need to think of a way to make sure they are returned. You
should be able to accomplish that by using case statements in your query.
Syntax may vary depending on your database, but should be something like
this (assume you db field is called "response"):

Sum(case response = 'agree' then 1 else 0 end) as agree,
Sum(case response = 'disagree' then 1 else 0 end) as disagree,
Sum(case response = 'strongly agree' then 1 else 0) as strongly_agree

And so on for each possible value. Your resultset will then contain a total
for each possible value, and a 0 if a value wasn't found at all.

On Wednesday, December 10, 2014, Torrent Girl <moniqueb...@gmail.com> wrote:

>
> Russ there is only one loop.
>
> It's a very simple table with a static first row with headers and a simple
> query loop to add columns.
>
> So here is my header row:
> Agree, Disagree, Neither Agree nor Disagree, Strongly Agree, Strongly
> Disagree
>
> And here is my dynamic row created from the query:
>
> Agree, Disagree,  Strongly Agree, Strongly Disagree
>
>
> So, if 'Neither Agree nor Disagree' is not returned from the query, I am
> short of one cell and it throws it off.
>
> I need to create an empty cell for each one that wasn't returned.
>
>
>
> >why do you need the 2nd loop rather than simply outputting the value of
> the
> >query column from the main loop?
> >
> >On Thu, Dec 11, 2014 at 12:02 AM, Torrent Girl <moniqueb...@gmail.com
> <javascript:;>>
> >wrote:
> >
> >>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359813
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to